The insurgents in a military camouflage gun truck stormed the area around 8pm on Saturday, shooting sporadically.
They also made an attempt to overrun a military formation located within the area, a source said.
“We lost three soldiers during a shootout with the terrorists. I was told there were casualties from their end as well,” a colonel reported.
Boko Haram and its offshoot, Islamic State West Africa Province, have killed thousands and displaced millions in northeastern Nigeria.
The Nigerian military has repeatedly claimed that the insurgency has been largely defeated and it frequently underplays any losses.
In the past months, soldiers have been targeted by the insurgents.
Hundreds of soldiers and officers have been reportedly killed since January 2021.
At least 33 soldiers were recently killed when two explosive-laden vehicles rammed into a military convoy in Wulgo.
The suicide bombers were identified as Abu Bakr al-Siddiq and Bana Jundullah. The group also claimed four military vehicles were destroyed.
In February, about 20 soldiers were also killed in Malari, Borno State by the insurgents.
Gathered by our reporters that the soldiers were on patrol to clear some Boko Haram elements in the area following a credible intelligence when they were ambushed by the group.