Suspected Boko Haram fighters opened fire on secondary school students as they slept in a dormitory in Nigeria's northeastern Yobe state, the military said.
Casualty figures from the attack in the town of Buni Yadi, roughly 60km from the state capital Damaturu, were not immediately available but scores of students have been killed in similar attacks in the state in the last year.
The military spokesman in Yobe, Lazarus Eli, said the raid occurred at 2am (0100 GMT) at the town's Federal Government College, a school for students aged 11 to 18.
The gunmen "opened fire on student hostels", Eli said.
"Details are still sketchy due to lack of telephone access and it is still not clear how many students were affected in the attack," he added.
The name Boko Haram means "Western education is forbidden" and the rebels have carried out waves of attacks at schools across the north during their four-and-a-half year insurgency.
At least 40 students were killed in September at an agriculture training college in the Yobe town of Gujba in September after Boko Haram gunmen stormed a series of dorms in the middle of the night and sprayed gunfire on sleeping students.
Yobe is one of three northeastern states which was placed under emergency rule in May last year when the military launched a massive operation to crush the Boko Haram uprising.
More than 1,000 people have been killed in the region since the emergency measures were imposed, despite the enhanced military presence.
Boko Haram, declared a terrorist organisation by Nigeria and the United States, has said it is fighting to create an Islamic state in Nigeria's mainly Muslim north.