Military spokesman Aliyu Danja said the military repelled the insurgents' attempt to launch coordinated attacks at three remote towns -- Bama, Gwoza and Pulka.
"Troops of army division 7 of the Nigerian Army has foiled yet another attack by Boko Haram terrorists aimed at inflicting havoc on Borno state prior to Sallah festivities," the military official said.
"The terrorists of unknown strength attempted coordinated simultaneous attacks on Bama, Gwoza and Pulka town in Borno state Sunday. The soldiers of 7 division, however, successfully repelled all the attacks killing 40 terrorists," the spokesperson added.
Danja said that soldiers also destroyed a pickup vehicle loaded with explosives, which were meant for the destruction of Bama town.
According to him, the Nigerian Air Force collaborated with some ground troops from the army division in a special operation targeted at the "Boko Haram elements and their assets". He said the operation was successfully.
Activities of the Boko Haram sect have recently been on the increase in Borno, which shares a border with Cameroon, Niger and Chad.
In April, the Nigerian government tried to broker a ceasefire with the sect but failed.
The Boko Haram sect seeks to enshrine the Islamic sharia law into the constitution and declares war against the Western education.