Details were sketchy and the information could not be independently confirmed. Mobile phone lines have been cut in much of the northeast since the start of a military offensive targeting Islamist extremist group Boko Haram on May 15 and access to the area is limited.
The attackers were said to have stormed student living quarters last night in the city of Damaturu and shot sporadically, killing seven students and two teachers. Two insurgents were also killed, the military said.
"Two teachers and two insurgents were killed during the separate attack, while seven innocent students lost their lives," he said in a statement.
"Three of the Boko Haram terrorists were arrested and are presently in (military) custody."
More From This Section
The sequence of events was unclear, including whether the shootout occurred around the school or at the checkpoint. Lazarus could not be reached for further information.
Boko Haram, whose name roughly translates to "Western education is sin," has carried out multiple attacks on schools in violence-torn northeast Nigeria.
The insurgency has left some 3,600 people dead since 2009, including killings by the security services, who have come under major criticism over alleged abuses.