Boko Haram fighters have amassed in the group's Sambisa Forest stronghold in northeast Nigeria, as a military offensive tries to flush them out, a civilian vigilante told AFP on Thursday.

But soldiers were forced to retreat because of the extensive use of landmines in the area, one of which exploded killing a soldier and three vigilantes.

"Boko Haram are in large numbers in Sambisa," said the vigilante, who requested anonymity for security reasons as he was part of the operation.

"All their fighters who were pushed out of Bama, Dikwa, Gwoza and Damboa (in Borno state) all moved to Boko Haram camps in Sambisa," he added.

Details of the offensive came as a series of photographs circulated on social media accounts linked to the Islamic State group of heavily armed fighters, purportedly from Boko Haram.

No independent verification was possible but some of the accounts said the images were released under the name "The Islamic State in West Africa".

Boko Haram chief Abubakar Shekau pledged allegiance to IS group leader Abu Bakr al-Baghdadi in March. The Middle Eastern militants responded by urging Muslims to support the rebels in Nigeria.

A four-nation military operation launched in February involving Nigeria, Chad, Niger and Cameroon has recaptured swathes of territory previously held by Boko Haram in three northeast states.

Niger soldiers patrol Malam Fatori on April 3, 2015, after the town in north-eastern Nigeria was retaken from Boko Haram Philippe Desmazes, AFP

Last week, Nigeria's national security advisor Sambo Dasuki said troops would storm the vast Sambisa Forest by the handover of power to incoming president Muhammadu Buhari on May 29.

It has been claimed that the 219 schoolgirls kidnapped last April from the town of Chibok 80 kilometres (50 miles) away were being held in the area.

Others have said they may have been split up and could be in Cameroon, Chad or elsewhere in northern Nigeria.

- 'Defying obstacles' -

On Wednesday, the military said an offensive was under way "in some forest locations", claiming to have killed a senior commander as well as a number of militants who attacked a patrol.

"The operations especially in forest locations are progressing in defiance of obstacles and landmines emplaced by the terrorists," defence spokesman Chris Olukolade said in a statement.

But the vigilante said progress over the last three days had been severely hindered.

"Boko Haram have buried landmines all over the routes leading to their camps in the forest, which is no doubt a huge obstacle retarding the military offensive against them," he said.

Troops were forced to turn back just five kilometres (three miles) from Boko Haram's main camp because of landmines.

One soldier and three vigilantes were killed when their vehicle hit a mine, he said.

"There are no soldiers in Sambisa right now. We all returned to Bama after the horrifying experience of manoeuvring through minefields," he added.