The Federal Polytechnic Mubi campus ( Reuters

Gunmen have killed at least 26 people in a student hostel in a town in northeastern Nigeria.

The massacre happened near the Mubi Federal Polytechnic campus, where student elections were being held.

"They are conducting elections in the polytechnic and unknown gunmen just entered and sprayed people with bullets," Red Cross worker Abdulkarim Bello said.

A lecturer at the university told the BBC that the assailants wore military uniforms and made the students stand in line and spell out their names before they were shot or stabbed.

The corpses were lined up outside the building, the lecturer added.

The reasons behind the attack were not known. Suspicions rested on Islamist terrorist group Boko Haram but the group has not claimed responsibility.

Members were active in the area and police had just conducted a major operation in Mubi. One of Boko Haram's senior leaders was among 156 suspects in the sweep.

Officials said that the polytechnic slaughter could have been related to the student elections.

National Emergency Management Agency spokesman Yushua Shuaib said the shooting could have been caused by a dispute between rival political gangs.

In September Boko Haram carried out a series bomb attacks against phone companies accused of helping authorities track down its members. More than 20 mobile phone masts were put out of action.

Earlier this year about 15 people were killed by a Boko Haram gunman who targeted Christians who gathered in Mubi's town hall.