Nigeria’s military has uncovered a Boko Haram bomb-making factory in the northeastern town of Buni Yadi after the town was retaken from the militants.

A Boko Haram bomb-making factory has been uncovered in the northeast of Nigeria. The country’s military has said they found it inside a fertilizer company in the town of Buni Yadi in Yobe State, after retaking the area from the insurgents.

The soldiers have found suicide bomber vests and improvised explosive devices at the site.

"A large quantity of IEDs [improvised explosive devices], including those commonly used by suicide bombers were recovered from the site," AFP quotes Defense spokesman Chris Olukolade as saying in an emailed statement.

"The factory, which was located in a fertilizer company, has also converted some of the materials therein for production of all types of IEDs,” he added. "Troops are still evacuating the materials which include a large quantity of suicide bomber vests from the facility to their base."

Olukolade said Boko Haram militants planted explosive devices along the highway on their way out, which delayed the soldiers' advance. Four soldiers were killed by IEDs during the operation to retake Buni Yadi.

Islamist fighters captured the town in Yobe state in August of last year; it was one of many seized in the troubled northeast. The country’s troops have battled the militants for months to regain control, and said they recaptured it last Saturday.

The discovery comes days after the Nigerian fundamentalist group pledged their allegiance to the so-called Islamic State. The audio message was posted on Boko Haram's Twitter account and appeared to have been written by the group's leader but remains unconfirmed.

The Islamic State accepted the pledge.

Boko Haram was founded in northern Nigeria in 2009 as an effort to impose Islamic rule there. The group is believed to have killed more than 5,000 civilians between 2009 and 2014 in attacks occurring mainly in northeast, north-central and central Nigeria but which have also spilled into neighboring states including Chad, Niger and Cameroon.