At least 46 students have been killed by a suicide bomber at a school assembly in the north-eastern Nigerian town of Potiskum, police have said.
A suicide bomber dressed as a student is believed to have caused the blast at the boys' school in Yobe state .
Police suggested the militant group Boko Haram carried out the attack.
Yobe state's governor has shut all public schools around Potiskum and criticised the government for not tackling the group.
In a statement governor Ibrahim Gaidam said: "Urgent action must be taken right now to restore a fast-waning public confidence by doing whatever it takes to stop the escalating violence."
Boko Haram has targeted schools during a deadly five-year insurgency aimed at establishing an Islamic state.
It is waging a sustained campaign to prevent children from going to school. It believes girls should not attend school and boys should only receive an Islamic education.
However thousands of people, not just schoolchildren, have been killed by the group.
On 17 October the Nigerian government claimed to have negotiated a ceasefire with Boko Haram.
But two weeks later the group's leader, Abubakar Shekau, denied these claims and said in a video: "We have not made ceasefire with anyone. We did not negotiate with anyone. It's a lie."
The explosion ripped through the assembly hall at the Government Science Secondary School.
Police spokesman Emmanuel Ojukwu told the BBC Hausa service the attack had left 47 people dead, including the suicide bomber. Another 79 were wounded.
Dozens of students were injured so severely medics were unable to save them.
Analysis: Will Ross, BBC Nigeria Correspondent
By setting off the bomb during the morning assembly, the militants clearly aimed to kill as many students as possible.
Few of the attacks here are ever claimed by any group but Boko Haram will once again be suspected. The jihadists have carried out particularly brutal attacks on schools before.
Chibok is known in many parts of the world because of April's mass abduction of girls from that remote village. But there have been many other horrific attacks on schools which have received less attention - including last February's raid on Buni Yadi, in Yobe state.
Dozens of boys were burnt to death, shot or killed with knives in the dormitory. Female students were spared but told to never attend school again, go off and get married. Boko Haram wants the education of boys to be limited to strict Koranic studies only.
The insecurity in the north-east is so rampant, with entire towns and villages now in the jihadists' hands, it will be extremely hard for other bombings to be prevented.
"At about 08:00am [07:00 GMT], a suicide bomber disguised himself as one of the male students and while the school was holding its normal assembly, the bomb went off," Mr Ojukwu said.
He added that police were investigating the explosion.
Students reportedly questioned the bomber as he tried to blend in with them before the attack.
Nigerian President Goodluck Jonathan issued a statement offering his "heartfelt commiserations" to those affected in Yobe state.
Though he admitted that Nigeria had seen setbacks in its fight against terror, the president maintained that those responsible would be "brought to justice and made to pay for their atrocious crimes".
One student told the BBC he saw the mutilated bodies of fellow students at the scene. A resident reported seeing parents wailing at the sight of their children's bodies at the hospital.
Soldiers who attended the site of the explosion were met with fury by the assembled crowds who pelted them with stones and accused them of not doing enough to halt Boko Haram's insurgency.
A grieving relative told the BBC: "My brother, a student in the school, died in the blast. He was about 16 years old... We buried him at about 11:00am [10:00 GMT] today."
"The government needs to be more serious about the fight against Boko Haram because it is getting out of control," he added.
Schools in Yobe state have been frequently attacked by Boko Haram militants.
The state is one of three in Nigeria that have been placed under a state of emergency as a result of the group's activities.
Potiskum, one of the largest towns in Yobe, has been targeted before by Boko Haram.
Last week, a suicide bombing killed 15 people in the town.
The bomber joined a religious procession of the rival Shia Muslim sect, before blowing himself up.
Nigeria's police spokesperson told the BBC officers were making progress against the terrorists. "Our mandate is to secure safety and security," he said. "By and large we are making good successes."
The BBC's Will Ross says the authorities are unwilling to admit that the crisis in north-east Nigeria is worsening. The jihadists have taken over towns and villages and there have been some reports of the army fleeing rather than fighting.
In April, Boko Haram sparked global outrage by abducting more than 200 girls from a boarding school in Chibok town in Borno state.
Boko Haram leader Abubakar Shekau has dismissed government claims to have agreed a ceasefire, under which the girls would be released.
He says the children have converted to Islam, are learning to memorise the Koran and have been married off.
Who are Boko Haram?
- Founded in 2002
- Initially focused on opposing Western education - Boko Haram means "Western education is forbidden" in the Hausa language
- Launched military operations in 2009 to create Islamic state
- Thousands killed, mostly in north-eastern Nigeria - also attacked police and UN headquarters in capital, Abuja
- Some three million people affected
- Declared terrorist group by US in 2013