The ISIS extremist group has claimed responsibility for the deadly bombing on Saturday near an education centre in the Afghan capital that killed 24 people.
ISIS announced in a statement posted on its social media channels that a suicide bomber “set off towards a gathering... in Kabul, where he detonated his explosives jacket among the crowd."
Interior ministry spokesman Tariq Arian said the bomber detonated his explosives in the street outside the Kawsar-e Danish centre.
“A suicide bomber wanted to enter the education centre,” Mr Arian said. “But he was identified by the centre’s guards after which he detonated his explosives in an alley.”
The attack happened in the late afternoon in Dasht-e Barchi, a western district of the Afghan capital, at a centre that offers training and courses for students in higher education.
Most of the victims were students aged between 15 and 26, according to the health ministry. Fifty-seven were injured in the attack, the interior ministry said.
Residents in several districts of western Kabul belong to the minority Shiite Hazara community, often targeted by Sunni extremists including ISIS.
A teacher at the education centre, who asked not to be named due to security concerns, said the teaching staff were in shock at the attack on an institution that provided tutoring to give thousands of children a pathway to higher education.
"All the students were full of energy, belonging to poor families but hoping for a brighter future," he told Reuters.
Attack widely condemned
Stefanao Pontecorvo, Nato Senior Civilian Representative to Afghanistan, condemned the attack.
He was joined by Dr Abdullah Abdullah, Chairman of the High Council for National Reconciliation, who termed it "coward suicide attack".
EU Special Envoy to Afghanistan Roland Kobia called for an immediate ceasefire after the attack.
Violence in Afghanistan has surged in recent weeks, despite the Taliban and government holding intra-Afghan peace talks to end the country's years-long war.
The US signed a peace deal with the Taliban in February, opening a path towards withdrawing American troops from the conflict.
Earlier on Saturday a roadside bomb killed nine people in eastern Afghanistan after it struck a minivan carrying civilians, a local official said.
Ghazni province police spokesman Ahmad Khan Sirat said a second roadside bomb killed two policemen after it struck their vehicle, which was making its way to victims of the first explosion.
Mr Sirat said the bombings had wounded several others, and that the attacks were under investigation.