Kingsley Samuel, deputy director, army public relations seventh division, who disclosed this in a statement, said 19 other soldiers were wounded in the attack.
However, he added that troops killed many of the insurgents.
“Troops of Operation Lafiya Dole gallantly fought their way through Boko Haram terrorists ambush along Ajiri-Dikwa road, Borno state,” he said.
“Elements of troops affected encountered the ambush while conducting routine rotation of troops last night. The gallant troops fought their way through, killing many of the terrorists.
“Unfortunately seven soldiers paid the supreme price in the incident, while 19 soldiers sustained various degrees of injuries.
“The soldiers who sustained injuries during the fierce encounter have been evacuated and are currently receiving treatment at military hospital in Maiduguri. The troops recovered an AK-47 rifle and ammunition from the insurgents.”
Samuel also said more troops had been mobilised, and that they were on an aggressive pursuit of the fleeing insurgents.