The attack occurred during afternoon prayers in the village of Fombita in the rural commune of Kokorou, which is near the tri-border region of Niger, Burkina Faso and Mali known as the epicentre of a jihadist insurgency in West Africa linked to al Qaeda and Islamic State.
The defence ministry of Niger Republic blamed the attack on the EIGS group, an Islamic State affiliate, in a statement late on Friday.
Heavily armed jihadists encircled a mosque, where people had gathered for prayers during the Muslim holy month of Ramadan, and carried out a “massacre of rare cruelty”, it said.
The attackers then set fire to a market and houses before retreating, the ministry said.
Troops deployed to the scene provided a provisional death toll of 44 civilians, with 13 severely injured. Three days of national mourning have been declared.