Njoka Irabor, a spokesman for the army in the northeast region, said a commander of the Boko Haram group identified as Mukhtar was among those killed in the encounter late Sunday in Damaturu, the capital of Yobe.
Mukhtar was known to have coordinated most of the ambushes against the Nigerian troops along the fringes of Lake Chad, Irabor said.
According to the spokesman, the terror group had attempted to invade the city of Damaturu to wreak havoc on the residents but the troops thwarted the attack.
The gunfight, which prevented the Boko Haram militants from gaining entry into the city, lasted at least three hours, the spokesman said.
The northeast region in Nigeria has been destabilized for over a decade by Boko Haram, which most notoriously kidnapped hundreds of schoolgirls in 2014.
Boko Haram is known for its agenda to maintain a virtual caliphate in the most populous African country.