"We can confirm the attack was caused by a suicide bomber on foot. The bomber detonated himself inside the education centre," police spokesman Hashmat Stanikzai was quoted as saying by AFP news agency.

Image copyrightEPAImage caption
The bombing comes at a time of renewed unrest in Afghanistan

"Most of the boys at the educational centre have been killed," Sayed Ali, who witnessed the blast, was quoted as saying by Reuters news agency. "It was horrific and many of the students were torn to pieces."

Another man, who gave his name as Assadullah, told AFP news agency how he had run toward the blast scene to try and rescue his 17-year-old brother inside.

"He was a smart and energetic boy, top of his class," he said. "Now... I am not sure he will survive."

Image copyrightReutersImage caption
Relatives pictured next to the coffins of policeman who were killed in the Baghlan attack

Afghanistan has seen a recent upsurge in militant violence, including a major Taliban assault on the eastern city of Ghazni.

At least 100 members of the security forces were killed in the fighting at Ghazni, officials have said.

The UN has warned that as many as 150 civilians may have also been killed.

Tadamichi Yamamoto, the UN's Special Representative for Afghanistan, made an appeal on Wednesday for violence to end.

"The extreme human suffering caused by the fighting in Ghazni highlights the urgent need for the war in Afghanistan to end," he said in a statement.