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.
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.