At least 30 people have been killed and many more were injured after a bomb exploded near a girls’ school in a majority Shia district of the Afghan capital Kabul.
Many of the victims were pupils aged between 11 and 15 years old, an Afghan government spokesmen said.
The Taliban condemned the attack, apparently aimed at civilians, and denied any responsibility.
Ambulances rushed to evacuate the wounded from the scene of the blast near Syed Al-Shahda school, in the Shia majority area of Dasht-e-Barchi, in the west of the city.
Residents said the explosion was deafening.
One local man told The Associated Press he heard three separate explosions, although there was no official confirmation of multiple blasts.
While no-one has claimed responsibility for the bombing, previous brutal attacks in the same area have been claimed by the Afghan affiliate of the so-called Islamic State (IS).
The radical Sunni Muslim group has declared war on Afghanistan’s minority Shia Muslims.
Washington blamed IS for a vicious attack last year in a maternity hospital in the same area that killed pregnant women and newborn babies.
In Dasht-e-Barchi, angry crowds attacked the ambulances and even beat health workers as they tried to evacuate the wounded, health ministry spokesman Ghulam Dastigar Nazari said.
He implored residents to cooperate and allow ambulances free access to the site.
Images circulating on social media purportedly showed bloodied school backpacks and books strewn across the street in front of the school, and smoke rising above the area.
At one nearby hospital, journalists saw at least 20 dead bodies lined up in hallways and rooms, with dozens of wounded people and families of victims pressing through the facility.
Outside the Muhammad Ali Jinnah Hospital, dozens of people lined up to donate blood, while family members checked casualty lists posted on the walls.
Officials said that at least 50 people were also wounded, and it is feared the casualty toll could rise. The attack occurred just as the fasting day came to an end.
No-one immediately claimed responsibility for the attack, and Taliban spokesman Zabihullah Mujahid told reporters in a message that only IS could be responsible for such a heinous crime.
The Taliban and the Afghan government have traded accusations over a series of targeted killings of civil society workers, journalists and Afghan professionals.
While IS has taken responsibility for some of those killings, many have gone unclaimed.
IS has previously claimed attacks against minority Shias in the same area, last year claiming two brutal attacks on education facilities that killed 50 people, most of them students.
Even as the IS has been degraded in Afghanistan, according to government and US officials, it has stepped up its attacks particularly against Shia Muslims and women workers.
Earlier the group took responsibility for the targeted killing of three women media personnel in eastern Afghanistan.
The attack comes days after the remaining 2,500 to 3,500 American troops officially began leaving the country.
They will be out by September 11 at the latest. The pullout comes amid a resurgent Taliban, who control or hold sway over half of Afghanistan.
The top US military officer said Afghan government forces face an uncertain future and possibly some “bad possible outcomes” against Taliban insurgents as the withdrawal accelerates in the coming weeks.