Katsina state police spokesman Gambo Isah said gunmen on motorcycles stormed into the village of Yargamji in Batsari district, some 50 kilometers (30 miles) from the state capital Katsina, on Tuesday, and opened fire at the resident, Presstv Reported.
"They killed 18," he said.
A gunfight broke out in the forest after a self-defense militia from another village chased the thieves.
Police said two militia members were shot dead during the gun battle, but residents said the fight claimed the lives of more people.
"We lost 11 people who went to fight the bandits in the bush," resident Sada Iro said.
Iro noted that five residents were also killed in other attacks in the nearby village of Mara Zamfarawa.
Katsina state has seen a string of violent attacks in recent months that claimed the lives of hundreds of people.
The gunmen have repeatedly conducted raids on villages, stealing cattle and food, setting homes ablaze and kidnapping for ransom, prompting rural communities to take up arms to defend themselves.
Nigeria also suffers from attacks conducted by Boko Haram Takfiri terrorist group, which began its activities in northeastern Nigeria in 2009. It has spread them into the neighboring countries of Niger, Chad, and Cameroon.