The man opened fire on students as they underwent security checks outside the College of Administrative and Business Studies (CABS) in Potiskum at 8:10 a.m. local time, and rushed into the school firing sporadic shots while being chased by students and residents, a witness said.
"We have evacuated 12 people with serious gunshot wounds to hospital from the scene of the shooting attack," a police officer said on condition of anonymity because he was not authorized to speak about the incident. A paramedic at the Potiskum General Hospital said the hospital received 12 people with serious injuries.
"The gunman died after he set off his suicide explosives as he was being chased inside the school, but no one was hurt," the officer said.
Two accomplices fled the scene, and the Nigeria Police Force said on Twitter that they "have now been arrested at different locations after coordinated pursuit."
Police said an AK-47 rifle and ammunition were recovered from the suspects.
The police official said the radical Islamist group Boko Haram is the primary suspect, having carried out similar attacks -- with much deadlier results -- on schools in Yobe state in the past two years:
-- In July 2013, attacks on student dormitories in Government Secondary School Mamudo left 41 students and a teacher dead.
-- In September 2013, at least 40 students were killed in a nocturnal gun and bomb attacks -- for which Boko Haram claimed responsibility -- on student hostels at a government agriculture college in Gujba.
-- In February 2014, dozens of students were killed in their sleep when Boko Haram gunmen attacked the student hostels in Federal Government College, in the town of Buni Yadi in Yobe state.
-- In November 2014, at least 58 students were killed and 117 injured when a suicide bomber attacked a crowded student assembly ground inside Government Comprehensive Secondary School just next door to CABS.
Adamu Ahmad, a student at CABS, said the gunman in Friday's attack ran into the school firing at his pursuers "without hitting any" of them.
"After exhausting his ammunition he detonated the explosives concealed under his kaftan, killing himself. But no one from the crowd was affected because they were some distance away," said Ahmad, whose account was corroborated by other witnesses.
"We had just started a class when we heard gunshots coming from the direction of the gates and we instantly realized we were under attack, which made us to rush out of the class," said another student, Tijjani Musa.
"I then saw a man in a kaftan being pursued by a crowd across the open field who kept turning and firing shots at the crowd and then suddenly he exploded with a deafening sound."