The attack happened in a dorm College of Agriculture in Gujba, Yobe state, Channels Television reported.
Nigerian army spokesman Captain Eli Lazarus told Voice of America that a number of unknown gunmen stormed the dorm and opened fire on sleeping students.
At least 40 students were killed in the attack, Voice of America said. Another 18 students were being treated for injuries.
The terror group Boko Haram has not yet claimed responsibility for the attack, but is active throughout Nigeria and in July carried out a similar attack on a high school dormitory, killing 29 students and a teacher.