The explosion took place as students were leaving the building on Saturday, with pictures on social media showing abandoned school bags in the street.
Most of those hurt were girls, a ministry of education spokeswoman said.
No-one has admitted carrying out the attack in Dasht-e-Barchi - an area often hit by Sunni Islamist militants.
The neighbourhood is home to many from the Hazara minority community, who are of Mongolian and Central Asian descent and are mainly Shia Muslims.