Kaaj Higher Educational Center coaches students, mainly adult men and women, to prepare for university entrance exams.
Families rushed to area hospitals, where ambulances were arriving with victims and lists of those confirmed dead and wounded were posted to the walls.
“We didn’t find her here,” a distressed woman looking for her sister at one of the hospitals told AFP. “She was 19 years old.”
“We are calling her but she’s not responding.”
At least one hospital, the Taliban forced families of victims to leave the site, fearing that there could be a follow-up attack on the crowd.
Videos posted online and photos published by local media showed bloodied victims being carried away from the scene.
“Security teams have reached the site, the nature of the attack and the details of the casualties will be released later,” Abdul Nafy Takor, the interior ministry’s spokesman, earlier tweeted.
“Attacking civilian targets proves the enemy’s inhuman cruelty and lack of moral standards.”
The Taliban’s return to power in Afghanistan last year brought an end to the two-decade war and a significant reduction in violence, but security has begun to deteriorate in recent months.
Afghanistan’s Shiite Hazaras have faced persecution for decades, with the Taliban accused of abuses against the group when they first ruled from 1996 to 2001.
Such accusations picked up again after they swept back to power.
Hazaras are also the frequent target of attacks by the Taliban’s enemy, the Islamic State armed group. Both consider them heretics.
Many attacks have devastated the Dasht-e-Barchi neighbourhood, with many targeting women, children and schools.
Last year, before the Taliban returned to power, at least 85 people -- mainly girl students -- were killed and about 300 wounded when three bombs exploded near their school in the area.
No group claimed responsibility, but a year earlier IS claimed a suicide attack on an educational centre in the same neighbourhood that killed 24, including students.
In May 2020, the group was blamed for a bloody gun attack on a maternity ward of a hospital in Dasht-e-Barchi that killed 25 people, including new mothers.
And in April this year, two deadly bomb blasts at separate education centres in the area killed six people and wounded at least 20 others.
Education is a flashpoint issue in Afghanistan, with the Taliban blocking many girls from returning to secondary education, while the Islamic State also stands against the education of women and girls.