Army spokesman Timothy Antigha said in a statement that the Islamists launched a "massive" attack on the town of Konduga, about 35 kilometres (22 miles) from Maiduguri, at 1000 IST today.
"After about three hours of fierce fighting, Nigerian troops routed the Boko Haram fighting force of over 100 terrorists," he said, adding that the insurgents suffered heavy casualties.
Four pick-up trucks with mounted anti-aircraft guns, three heavy machine guns, more than 30 AK-47 assault rifles and two global positioning systems were recovered by troops, he added.
The battle came a day after the Borno Elders Forum called for military reinforcements to protect Maiduguri, warning that the key city was "completely surrounded" by the militants.
Also Read
There has been mounting concern at the extent of Boko Haram's land grab in Borno and neighbouring Yobe and Adamawa states, which has raised concerns about a possible loss of government control.
Nigeria's military have repeatedly rejected claims about Boko Haram taking over towns and villages, despite multiple testimonies from fleeing residents.
Thousands of people fled to the state capital but there have since been conflicting reports about whether the militants were still in control.
The Bama Development Foundation, a community group, maintained that the town was still "under the custody and control of the dreaded Boko Haram sect" and many residents were still trapped.
The group's leader, Mohammed Hassan, said those trapped in the town were "dying of hunger and stress" and urgent action was needed to reclaim the town.
No military offensive had been launched to reclaim Bama, Hassan said, refuting the government's claim that its troops had recaptured the town.