With the Taliban regaining ground, we look at some of the obstacles and success stories in a country where conflict and cultural values have affected millions of children.
In 2001, the Taliban lorded over Afghanistan. Their iron rule meant that fewer than one million boys went to school - and girls were almost completely excluded from education.
By last year, after 15 years of conflict, peace-building and efforts to rid the country of the fundamentalist group, that figure had soared. More than nine million children were at school - 40% of them were girls.
But the Taliban have gradually been regaining ground and now hold more territory than at any time since 2001.
And after many years of progress, the cause of education for all in Afghanistan is still a long way off. Here's a look at some of the issues, obstacles and success stories.
One in three children out of school
More than 3.5 million children, a third of Afghan kids, were out of school at the start of the school year in March - and the number is predicted to rise.
Three-quarters of them are girls - due not only to violence but also a lack of female teachers, early marriage and social restrictions in the conservative society.
Education Ministry spokesman Mujib Mehrdad said it was hard to say exactly how many children were out of school but the situation had deteriorated after years of progress.
Save the Children predicted the total number of Afghans missing school will rise by more than 400,000 this year.
That is partly due to insecurity and partly because up to one million Afghan refugees are expected to return from Pakistan in 2017 - among them children who will not make it to school.
Lack of basic skills
Just 66% of males and 37% of females aged 15 to 24 can read and write, according to a report published last year by the National Risk and Vulnerability Assessment Center.
It said 45.5% of Afghans attend primary school and 27% are at secondary school.
The Afghan government, USAID (United States Agency for International Development) and international donors have worked closely to rebuild Afghanistan’s education sector.
They have constructed more than 16,000 schools and recruited and trained over 154,000 teachers.
Girls trapped by child marriage
The majority of Afghan girls marry before the age of 19 - and 40% of these marriages were of girls between 10 and 13, a United Nations report showed last year.
A national action plan to end child marriage was launched in April by the Ministry of Information and Culture and the Ministry of Women's Affairs, with support from the UN Population Fund (UNFPA) and the Embassy of Canada.
"Most children, especially girls, cannot go to school once they are married which limits their opportunities and keeps them trapped in poverty,” said a report for the Institute for War and Peace Reporting by Sayed Najib Jawid, a specialist at Kabul Mental Health hospital.
Attacks on schools
More than 210 girls' schools were closed down in 2016 - denying nearly 51,000 girls access to education - said a UN report.
It said there were more than 1000 attacks on education between 2009 and 2012, including schools being set on fire, suicide bombings, bombs, killings of staff, threats to staff and abductions.
War is a way of life for many children. Child soldiers were recruited by the Afghan National Police, the Afghan Local Police and three armed groups - including the Taliban forces - in 2015, according to the UN.
One in four civilian casualties that year was a child. The UN verified 1306 incidents resulting in 829 child casualties (733 killed, 2096 injured) - an average of 53 children killed or injured every week.
Tens of thousands of children in Afghanistan are risking their health and safety every day by working in hazardous conditions, a Human Rights Watch report said in 2016.
Work is forcing them to miss out on education or combine the hardships of their work with going to school. Only half of those involved in child labour attend school.
Girls fight back
Six girls from the war-torn western province of Herat made world headlines when they were denied visas to take part in a global robotics competition in the United States.
But last month the team was allowed to show off its skills and won silver medals. Roya Mahboob, an Afghan tech entrepreneur who helped organise their visit, said the girls' efforts would "have a big positive message for the Afghan community."
Sadly, the father of one of the team was killed in an Islamic State bombing of a mosque in Herat earlier this month.
Helping to train teachers
Eighty graduates from Afghan universities are teaching 23,000 girls and boys in 21 schools under the Teach for Afghanistan scheme launched at the beginning of this academic year.
The scheme in Nangarhar province in eastern Afghanistan, was masterminded by 26-year-old founder Rahmatullah Arman.
He said: "For me, the biggest inspiration was when I went into schools where there were no chairs, no desks, often not even teachers, but the schools were still crowded with pupils.
“I never could have dreamed that one day I would be able to support these communities to establish classes for girls’ education.
"It is my dream that all girls in the country can one day receive an education.”
Afghan refugees in Pakistan
More than 1.3 million Afghan refugees live in Pakistan - half of them children.
When Aqeela Asifi won the Nansen Refugee Award in 2015, she promised to use some of the $100,000 prize money to expand the school where she has helped more than 1000 Afghan girls get an education.
That goal was achieved last year when she opened three new classrooms, a washroom and a fully-equipped science laboratory at the school in remote Kot Chandana village in Pakistan.
In the summer of 2016, Pakistan announced that more than three million Afghan refugees - some in the country since the Soviet invasion of Afghanistan in 1979 - needed to go home.
Since then, about 600,000 registered and undocumented Afghans refugees have been repatriated to an unstable nation where there are currently more than a million internally displaced Afghans.
Muppets make education cool
Girls' education is being promoted by muppets created by the Sesame Street team. Zeerak - a bespectacled orange boy - is a children's TV character who reveres his educated older sister.
His big sister Zari, introduced last year, has already proved a success on the Afghan version of Sesame Street, known as Baghch-e-Simsim.
Published on ReliefWeb on August 25, 2017.
The Convention on the Rights of the Child sets out the rights that must be realized for children to develop their full potential, free from hunger and want, neglect and abuse. It reflects a new vision of the child. Children are neither the property of their parents nor are they helpless objects of charity. They are human beings and are the subject of their own rights. The Convention offers a vision of the child as an individual and as a member of a family and community, with rights and responsibilities appropriate to his or her age and stage of development. By recognizing children's rights in this way, the Convention firmly sets the focus on the whole child.