Thirty Nigerien troops and two Nigerian soldiers have been killed in clashes with Boko Haram militants in Niger, the country's defence ministry says.
It says "hundreds of assailants" attacked a military post in the south-eastern town of Bosso, on the Nigerian border, on Friday night.
A counter-attack on Saturday morning allowed government troops to retake all positions in Bosso, the ministry says.
It says there were several dead and injured "on the enemy's side".
Boko Haram has not commented on the Nigerien defence ministry's statement.
The Islamist group is based in Nigeria but is being tackled by a multinational force, including soldiers from Niger.
Niger's President Mahamadou Issoufou has been praised in the West for rallying neighbouring countries to fight Boko Haram.
In March, six soldiers from Niger's army were killed in a Boko Haram ambush in the south-east.