Dozens of young girls were buried today at a desolate hilltop cemetery in Kabul, a day after a secondary school was targeted in the bloodiest attack in Afghanistan in over a year.

A series of blasts outside the school during a peak holiday shopping period killed more than 50 people, mostly female students, and wounded more than 100 in Dasht-e-Barchi, a west Kabul suburb populated mostly by Hazara Shiites.

Last week the school students had protested about a lack of teachers and study materials, said Mirza Hussain, a university student from the area. "But what they got (in return) was a massacre."

Minister for Foreign Affairs, Simon Coveney, said he was "deeply shocked and saddened" by the attack. "I wish a speedy recovery to those injured. This horrendous violence must end," he added.

Pope Francis also offered his prayers for the victims of the attack, describing it as "an inhumane action that killed many girls as they were leaving school".

"Let us pray for all of them and for their families, and that God might grant peace to Afghanistan," he said.

The Afghanistan government blamed the Taliban for the carnage, but the insurgents denied responsibility and issued a statement saying the nation needed to "safeguard and look after educational centres and institutions".

Yesterday's blasts came as the United States military continues to pull out its last 2,500 troops from the violence-wracked country despite faltering peace efforts between the Taliban and Afghan government to end a decades-long war.

Onlookers stand at the gates of the school where attack took place

Interior Ministry spokesman Tareq Arian told reporters that a car bomb detonated in front of the Sayed Al-Shuhada girls school, and when the students rushed out in panic, two more devices exploded.

Residents were shopping ahead of this week's Eid al-Fitr holiday - which marks the end of the Islamic holy month of Ramadan - when the blasts occurred.

Today, relatives buried the dead at a hilltop site known as "Martyrs Cemetery", where victims of attacks against the Hazara community are laid to rest.

Hazaras are Shiite Muslims and considered heretics by extremist Sunnis. Sunni Muslims make up the majority of the Afghan population.

Bodies in wooden coffins were lowered into graves one by one by mourners still in a state of shock and fear, an AFP photographer said.

"I rushed to the scene (after the blasts) and found myself in the middle of bodies, their hands and heads cut off and bones smashed," said Mohammad Taqi, a resident of Dasht-e-Barchi, whose two daughters were students at the school but had escaped the attack.

"All of them were girls. Their bodies piled on top of each other."

Books and school bags belonging to the victims still lay scattered at the site of the attack.

Afghan officials including President Ashraf Ghani blamed the Taliban.

"This savage group does not have the power to confront security forces on the battlefield, and instead targets with brutality and barbarism public facilities and the girls' school," Ghani said in a statement after the blasts.

The Taliban denied involvement, and insist they have not carried out attacks in Kabul since February last year.

This is when they signed a deal with Washington that paved the way for peace talks and withdrawal of the remaining US troops.