Dozens of jihadist fighters from an Islamic State-backed Boko Haram faction attacked the base on Sunday in the village of Kekeno, near the garrison town of Monguno, in Borno state.
Recent months have seen repeated attacks on military bases in the northern part of Borno, although Nigerian commanders have strongly denied reports of heavy troop casualties.
The authorities maintain the group, whose insurgency has left more than 27,000 dead in northeast Nigeria since 2009, is on the verge of defeat, despite the ongoing violence.
A senior military officer in the Borno state capital, Maiduguri, said the Islamists were equipped with anti-aircraft guns and rocket-propelled grenades on Sunday.
But they were unable to breach defensive ditches surrounding the facility, he added on condition of anonymity, as he was not authorised to speak to the media.
Boko Haram “met stiff resistance, which led to a battle that lasted for hours”, he said.
Details of the attack were slow to emerge as telecommunications infrastructure has been destroyed by fighting and there are strict controls on movement in rural Borno state.
People from the area were only able to reach Maiduguri on Tuesday as the military shut the main road for 24 hours as they searched for rebels in the bush.
“Boko Haram attacked at about 5:45 pm (1645 GMT) on Sunday. They came in several trucks and on motorcycles,” said bus driver Sani Madaye.
Madaye said he and other drivers were sitting in a shed near the military base at the time. He was on his way to the fishing town of Baga, on the shores of Lake Chad and was forced to stop.
“The gunmen used a herd of cattle as cover to attack the base but they were detected in nearby bushes as they approached their target,” he said.
“A truck carrying fighters attempted to break (through) the barrier but the driver was shot and the truck swerved and crashed,” added another witness, who gave his name as Abdullahi.
“Suddenly, there was heavy shooting from Boko Haram and soldiers responded with fire, and it lasted for around one hour.”
Troop reinforcements were sent from Monguno, eight kilometres (five miles) away, and a fighter jet was deployed that forced the jihadists to withdraw.
Further attempts were made to storm the base until Boko Haram finally withdrew at about 10:30 pm, said Madaye, adding there were no military casualties.
There was no indication of the number of Boko Haram casualties, despite there being “bloodstains all over” at first light, said Madaye. DM