Twenty-nine soldiers were killed in western Niger in an attack by suspected militias, the Defence Ministry said on Monday night, declaring a three-day national mourning period.
"The soldiers were targeted using improvised explosive devices and kamikaze vehicles by more than a hundred terrorists," the ministry said in a televised statement.
Two soldiers were seriously wounded and "several dozen terrorists" were also killed.
The attack took place near the country's border with Mali during military operations aimed at "neutralising the threat posed by the Islamic State" in the area, according to the Ministry.
"Communications from the terrorists, who were forced to withdraw, have been intercepted", the Ministry said, adding that the attackers "benefitted from outside expertise", without giving any further details.
A militia insurgency has plagued Africa's Sahel region for more than a decade, breaking out in northern Mali in 2012 before spreading to neighbouring Niger and Burkina Faso in 2015.
The "three borders" area between Niger, Mali and Burkina Faso is regularly the scene of attacks by militants affiliated with the Islamic State group and Al Qaeda.
The violence has fuelled military takeovers in all three countries, with Niger the latest to fall to a coup on July 26 that ousted Mohamed Bazoum, its democratically elected president.
In August, at least 17 Nigerien soldiers were killed and 20 wounded in an attack by suspected extremists near the border between Niger and Burkina Faso.