The attack was carried out in Kareto village, 335 kilometres north of the Borno state capital Maiduguri, military officials say.
Boko Haram raided a military base in north-eastern Nigeria near the border with Niger, killing several troops and stealing weapons, military sources said on Friday.
Militants in eight gun trucks launched a pre-dawn attack on Thursday on the base in Kareto village, 335 kilometres (210 miles) north of the Borno state capital Maiduguri, they said.
"The terrorists attacked the 153 Troops Battalion in Kareto around 4:00 am (0300 GMT) and subdued the soldiers who were forced to withdraw after a hard fight," an army officer who did not want to be named said.
"We lost several men but we are still working to establish their number. One thing we are sure about is that the base commander, a lieutenant colonel, was among those killed," he said.
He said the insurgents ransacked the base and carted away weapons and vehicles.
The militants "took troops by surprise" while they were working to fix communications equipment that had been destroyed in a rainstorm, said another officer, who also sought anonymity.
The troops could not seek support from two nearby bases because of the faulty equipment, he said.
Search and rescue teams were combing the area for missing soldiers and dead bodies, they added.
Kareto has been repeatedly attacked by Boko Haram militants, who have targeted dozens of military bases in attacks that have left scores of soldiers dead in the volatile region.
Two weeks ago, the group carried out multiple attacks on military bases in Borno state, overrunning three of them and stealing weapons.
On Sunday, militants attacked a Cameroonian military base near the border with Nigeria in the Lake Chad area, killing at least 24 people, including 16 troops, according to Cameroon's defence ministry.
The ministry also claimed that militants were killed in the incident.
Boko Haram's decade-long insurgency has killed 27,000 people and displaced about two million in Nigeria.
The violence has spilled over into neighbouring Niger, Chad and Cameroon, prompting a regional military coalition to defeat the group.