Lagos: Six Nigerian soldiers were killed in an ambush by jihadist gunmen in the restive northeast, military sources told AFP.

The assailants opened fire on an army convoy on Sunday near the village of Mayanti, near the border with Cameroon, in an area plagued by attacks by insurgents.

"We have lost six soldiers in an ambush by Boko Haram terrorists," one officer told AFP.

A second source, giving the same toll, said the military convoy had been on its way to the nearby town of Banki when they were targeted by heavy gunfire and rocket-propelled grenades.

The decade-long jihadist uprising has killed 36,000 people and displaced around two million from their homes in northeast Nigeria.

The United Nations has complained of a surge in violence in the conflict zone in recent weeks.

Anger has been growing among local residents about the army's failure to stem the attacks.

The military has repeatedly claimed that the insurgency has largely been defeated but attacks against civilians and soldiers continue on a near daily basis.

The conflict has spread to neighbouring Niger, Chad and Cameroon, prompting a regional coalition to fight the insurgents.

The jihadists fighting in northeast Nigeria have split into rival groups with one loyal to longtime Boko Haram leader Abubakar Shekau and another affiliated to the Islamic State group.