Attackers on motorcycles stormed the camp of a local self-defence militia near the village of Bakorat in the Tahoua region on Tuesday, said Attawane Abeitane, mayor of the nearby town of Tillia.
A gunfight lasted for several hours before Nigerien security forces arrived and repelled the attackers, Abeitane said. A security official said only one of the defence militia survived.
"These are terrorists who came from outside and there were many of them," Abeitane said. "There were deaths among the terrorists, and motorcycles were also burned."
No group claimed responsibility for Tuesday's attack. A local affiliate of Islamic State has killed hundreds in rural communities near the Malian border this year.
One raid on Bakorat and neighbouring villages in March killed 137 people, one of the deadliest days in Niger's recent history. Local officials blamed that attack on Islamic State in the Greater Sahara.
In the absence of a permanent military presence, some villages and towns have taken up arms to defend themselves, though security analysts fear this can stoke the violence.
The attack is part of a wider wave of violence that since 2017 has swept across West Africa's Sahel region, a band of arid terrain south of the Sahara Desert.
Some of the worst attacks have been centred in the border region of Niger, Mali and Burkina Faso. Thousands of civilians have been killed in the region, and millions displaced.