A senior security official told Reuters on condition of anonymity that most of the casualties were students coming out of the Sayed ul Shuhada school, and many were badly wounded in hospital.
Footage on TV channel ToloNews showed chaotic scenes, with books and school bags strewn across a bloodstained road, and residents rushing to help victims.
"It was a car bomb blast that occurred in front of the school entrance," an eyewitness told Reuters, asking not to be named. He said all but seven or eight of the victims were schoolgirls going home after finishing their studies.
At the Sayed ul Shuhada high school, girls and boys study in three shifts, the second of which is for female students, Najiba Arian, spokeswoman for the Ministry of Education, told Reuters. The wounded were mostly female students, she said.
A spokesman for the interior ministry, Tariq Arian, said the death toll was at least 30 with 52 injured.
SONS AND DAUGHTERS
At a nearby hospital, staff wheeled in injured students while dozens of distressed relatives searched for their sons and daughters, according to a Reuters witness.
"I do not know what country we are in ... We want peace and security," a grieving relative of one of the victims told Reuters.
Kabul has been on high alert since Washington announced plans last month to pull out all US troops by Sept. 11, with Afghan officials saying the Taliban have stepped up attacks across the country following the announcement.
No group has claimed responsibility for Saturday's attack. Taliban spokesman Zabihullah Mujahid denied the group was involved and condemned the incident.
Although Ghani blamed the Taliban, Saturday's explosions were in a heavily Shi’ite Muslim neighborhood that has faced brutal attacks by Islamic State militants over the years, including one on a maternity ward almost exactly a year ago.
Ghani said: "The Taliban, by escalating their illegitimate war and violence, have once again shown that they are not only reluctant to resolve the current crisis peacefully and fundamentally, but are complicating the situation."
'UNFORGIVABLE ATTACK'
Washington's top diplomat in Afghanistan, Ross Wilson, condemned the attack in a post on Twitter: "With scores murdered, this unforgivable attack on children is an assault on Afghanistan’s future, which cannot stand."
The Taliban and United States last year signed an agreement to end the 20-year war, which started with US and allied forces invading Afghanistan following the Sept. 11, 2001 attacks in the United States by al Qaeda, whose leader, Osama bin Laden, was being given shelter by the Taliban government.
Under the agreement, Washington was to pull out troops in exchange for Taliban security guarantees and for the group to start peace talks with the Afghan government. Talks began last year but have since stalled.
Taliban attacks on foreign forces have largely ceased, but they continue to target government forces. A number of journalists, activists and academics have also been killed in attacks blamed on the Taliban, who deny involvement.
Neighboring Pakistan, which has considerable influence over the Taliban and is pushing them to restart peace talks and agree to a ceasefire, also condemned the attack.Last month, Washington said it was pushing back the troop withdrawal deadline from May 1 to Sept. 11, which the Taliban warned could have consequences for the agreement.