At least 20 people, mostly students, have been killed by unknown gunmen in Mubi, north-eastern Nigeria, a police source has told the BBC.
The attack happened at a student hostel away from the Federal Polytechnic Mubi campus, the source said.
A lecturer told the BBC that more than 40 students had been killed but there has been no official comment.
The reported killing comes days after a major operation against the Boko Haram militant group in the town.
The lecturer, who did not want his name to be used, told the BBC’s Hausa service that men in military uniform asked the students to line up and then say their names.
Some were then shot dead and others stabbed with knives, and their bodies left in lines outside the buildings.
The lecturer says it is not clear why some were killed and others spared – some of those killed were Muslims and others Christian.
“Everybody is scared,” he said.
He added that students were now leaving the town, many with tree branches over their cars – a traditional sign of neutrality in Nigeria.
Other Mubi residents say they heard gunfire for about two hours during the night and that those living near the hostel were also targeted.
The authorities have imposed an indefinite curfew in the town and ordered residents to stay indoors.
Mobile phone masts attacked
Last week, the Nigerian military carried out an operation in Mubi and arrested dozens of people over suspected links to Boko Haram.
BBC Nigeria correspondent Will Ross says mobile phone masts in the area were recently attacked by the militants, so getting information from Mubi is difficult, and even the emergency services are struggling to communicate with their staff on the ground.
Mubi is in Adamawa state, which has a mixed Muslim and Christian population and borders Borno state, where Boko Haram came to prominence in 2009, staging an uprising in the state capital, Maiduguri.
Boko Haram has not yet commented on the Mubi attacks.
It is fighting to establish Islamic law in Nigeria and has killed more than 1,000 people in numerous attacks across northern and central areas this year.