The brazen operation -- which unfolded around the very city where Boko Haram was born -- turned the spotlight on the authorities' struggle to quell the jihadists' nearly nine-year-old offensive.
Boko Haram fighters attacked a military base in the Cashew Plantation area at the entrance to the city with suicide bombers, mortars and guns, leading to a prolonged battle, a senior military officer in Maiduguri said.
"Eighteen Boko Haram terrorists on foot attacked the military base while seven suicide bombers targeted residents of nearby Bale Shuwar and Alikaranti villages at 8:50 pm (1950 GMT)," said the officer who asked not to be identified because he was not authorised to speak about the incident.
"The terrorists fired mortars at troops," the officer said.
"So far we have recovered 18 dead bodies from the two villages," Bello Dambatto, an official from the State Emergency Management Agency (SEMA) told AFP.
"The victims were killed while trying to escape the fight between the insurgents and the military," said Dambatto.
'Huge blasts, gunfire'
One soldier was among the dead, the army said in a statement, which added that it had killed six insurgents and "neutralised" seven suicide bombers.
The attackers were trying to infiltrate into the city, said Ba'Kura Abba Ali, a militia leader in the area helping soldiers in fighting Boko Haram.
The assailants climbed up a trench that had been dug in the sand round the city to stave off Boko Haram suicide and gun attacks, and attacked troops, Ali said.
Maiduguri residents reported hearing at least five explosions and sounds of gunfire coming from the Cashew Plantation area.
"Huge blasts and sounds of gunshots were heard all over the city last night and they continued for more than an hour," said one resident, Ibrahim Gremah.
Boko Haram's nearly nine-year fight to establish a hardline Islamic state in northeast Nigeria has claimed at least 20,000 lives and displaced more than two million people.
On Friday, four girl suicide bombers aged between 13 and 18 killed two people in multiple attacks in Zawuya settlement on the outskirts of Maiduguri in the first assault since the government announced it was in ceasefire talks with Boko Haram.
The attacks highlight the challenge the government faces in striking a ceasefire agreement with Boko Haram.
In February, when more than 100 schoolgirls were returned to Dapchi after being kidnapped by the jihadist group, Nigerian President Muhammadu Buhari said his government was offering amnesty to "repentant" jihadists.
But the process is troubled by factionalism within Boko Haram, say senior security officials.
The group is divided into two factions that have competing goals and operational methods.
One, led by Abu Mus'ab al-Barnawi and affiliated with the so-called Islamic State, is reportedly in talks with the government. The other, led by Abubakar Shekau, is notorious for suicide bombings.
"Talks have been ongoing between the government and the insurgents from the Al-Barnawi faction," said a source, speaking on condition of anonymity.
The source said peace talks began in earnest after the July 2017 attack on an oil exploration team in Lake Chad that killed at least 69 people.
"The major headache now is extending the talks to the Shekau faction which is averse to negotiations. Dealing with them is quite problematic."
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.