The students were shot dead as they slept in their dormitory at the College of Agriculture in Yobe state.
North-eastern Nigeria is under a state of emergency amid an Islamic insurgency by the Boko Haram group.
Boko Haram is fighting to overthrow Nigeria’s government to create an Islamist state, and has launched a number of attacks on schools.
The number of casualties in the latest attack is unclear but there are fears the death toll could be high.
A military spokesman in Yobe state, Lazarus Eli, told Agence France-Presse news agency said the gunmen had also set fire to classrooms.
The college is in the rural Gujba district.
In June, Boko Haram carried out two attacks on schools in the region.
At least nine children were killed in a school on the outskirts of Maiduguri, while 13 students and teachers were killed in a school in Damaturu.
In July in the town of Mamudo, Islamist militants attacked dormitories with guns and explosives, killing at least 42 people, mostly students.
Error: No connected account.
Please go to the Instagram Feed settings page to connect an account.