As a global conference on the war-torn country begins, the number of out-of-school children and targeted attacks are rising.
When 12-year-old Elyas heard an explosion one morning in September, he and his school friends ran to see what had happened.
As they gathered outside a neighbouring girls' school in the Afghan city of Jalalabad, a second bomb exploded. A boy was killed and several others injured.
"I was wounded in the leg," said Elyas. "I saw girls crying, rushing out of school. They were all in a panic."
That horrific scene is becoming all too common in Afghanistan. In the first half of this year, there were twice as many attacks on education verified by the United Nations than in the whole of 2017.
The number of out-of-school children is increasing for the first time since 2002, according to the Global Coalition to Protect Education from Attack (GCPEA). The inter-agency organisation has released a briefing paper today as an international conference on Afghanistan begins in Geneva.
GCPEA said access to education for Afghan children - especially girls - has expanded significantly since 2001. Between then and 2015 there was a nine-fold increase in the number of children going to school.
But more than 3.7 million children, including 2.2 million girls, are still denied an education and this number has begun to rise, it added.
GCPEA said the past year has seen a rise in targeted attacks on schools, teachers and students.
In the first five months of this year, the government recorded 870 attacks on schools, threats or intimidation against students, education staff or facilities, or fighting by armed forces and groups in the vicinity of school grounds.
GCPEA said about 1000 schools are currently damaged, destroyed, occupied by armed groups or closed because of conflict.
“It is heart-wrenching to see mounting attacks on education in Afghanistan, putting at risk the progress made over the past 17 years, particularly in supporting girls’ education,” said Executive Director Diya Nijhowne.
“It would be a travesty if years of dedicated work, not to mention billions of dollars of aid investment, is allowed to unravel.”
The GCPEA warning echoed the findings of a report by Human Rights Watch last year, which said progress had stalled and two-thirds of Afghan girls do not attend school due to growing insecurity and poverty.
The UN children's agency UNICEF also released information on the eve of the Afghanistan conference.
Alison Parker, UNICEF Chief of Communication in Afghanistan, said in Geneva: "Increasing insecurity and a significant rise in school attacks puts almost two decades of progress at risk for Afghan children.
"Over 1200 schools are closed due to insecurity, meaning close to 600,000 students have been deprived of their rights to education."
Schools are meant to be safe places for children to learn. Afghanistan was one of the first nations to sign the Safe Schools Declaration - a commitment to secure schools and prevent attacks and military occupation of education buildings.
Theirworld is campaigning for all permanent members of the United Nations Security Council to back the declaration and send out a message that children should be safe when they are at school.
Major funding for education in Afghanistan has been announced recently. Education Cannot Wait - a fund for education in emergencies - is contributing to a programme to reach over 500,000 internally displaced and returnee children and youth.
And the Global Partnership for Education will give $100 million over five years to increase access to basic schooling, especially for girls in provinces that lag behind.
As the Afghanistan conference began, the UN also warned that a devastating drought in Herat and Baghdis provinces is driving many families to marry off their young daughters to pay off debts or to get dowries to buy food.
"Girls aged between eight and 12 are being sold to old men to solve the economic issues of their families," said Suraya Pakzad, who heads Voice of Women, Afghanistan. "It is very, very shocking."