An Associated Press reporter watched soldiers and police officers rush to the College of Administrative and Business Studies in Potiskum, where they have engaged the attackers in a firefight. Potiskum is the biggest town in Yobe state. It was too early to know if there are casualties.
The gunmen arrived around 8 am (0700 GMT) and opened fire at the school gate, witnesses said. Security guards ran away and it was not immediately clear if they had guns.
It is the first school attack reported since a 3-month-old multinational offensive has driven Boko Haram out of towns and villages seized last year. Boko Haram means "Western education is sinful."
Troops from neighboring countries joined the fight as Nigeria's home-grown Islamic extremist group began attacking across borders.
Nigeria's military says the main fighting force of Boko Haram has fled to strongholds in the vast Sambisa Forest, where Nigerian troops this month rescued nearly 700 girls and women held in captivity by the insurgents and destroyed about 20 camps.