Niger's army has been fighting an upsurge of violence by militants. / Photo: Reuters

Twenty-nine soldiers were killed in western Niger in an attack by suspected militants, the Defence Ministry has said, declaring a three-day national mourning period.

The soldiers were targeted on Monday night 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, according to the statement.

The attack took place near the country's border with Mali, during military operations aimed at "neutralising the threat posed by the Daesh" 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.

Troubled region

An 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 Daesh terror 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 militants near the border between Niger and Burkina Faso.

AFP