Dozens more were wounded at the Kaaj tuition centre, in the Dasht-e-Barchi area in the western part of the capital, which the UN Assistance Mission in Afghanistan (UNAMA) noted in a tweet, is a Hazara and Shia-majority area.
No group has yet claimed the attack, but affiliates of the terrorist group ISIL, or Daesh, have often targeted the Hazara minority in Afghanistan.
“The UN family condemns the outrage, extending its deep condolences to all those in mourning”, said the mission.
News reports said that the attacker shot at guards outside the facility, and then entered a classroom before detonating a bomb. Hundreds of students are reported to have been in the room at the time.
UN Children’s Fund, UNICEF, issued a statement saying it was “appalled the by horrific attack” early on Friday morning.
“This heinous act claimed the lives of dozens of adolescent girls and boys and severely injured many more. The victims were practising for the entrance exam to university.
“UNICEF offers its heartfelt condolences to all families affected by this terrible event and wishes a swift recovery to the injured.”
The agency said that any violence in any educational environment was “never acceptable”.
“Such places must be havens of peace where children can learn, be with friends, and feel safe as they build skills for their futures”, the statement continued.
“Children and adolescents are not, and must never be, the target of violence. Once again, UNICEF reminds all parties in Afghanistan to adhere to and respect human rights and ensure the safety and protection of all children and young people.”