KABUL — Deep in the concrete wall maze of central Kabul, the seniors of the all-girl Zarghoona High School keep one eye on their homework — and the other on the Taliban’s growing territory.

Students in the Class of 2021 are too young to have experienced the Taliban’s brutal years in power, but they’re old enough to understand what they read in history books. Many of them took their midterm exams last month ahead of graduation later this year, a rite of passage into an increasingly uncertain future. Since then, the Taliban has made staggering gains. The militants control half of the country’s 34 provincial capitals, holding key cities such as Kandahar and Herat and heightening concern of a government collapse.

Among the 1,300 girls in their final year is the Best Friends Group, a squad of three who say the dangers that lurked in their childhoods — extremist attacks on their schools, bombs detonated in their neighborhoods, targeted killings in their communities — have only drawn them closer together.

“We share the same thoughts, jokes, plans and even future careers,” said 17-year-old Belqees Niazi. “We want to enjoy our teenage years. We motivate each other. We make each other laugh.”

Inseparable since the fifth grade, Belqees and her friends Safia Hussain and Behishta Amini are part of two groups that have been targeted in the past decade in Afghanistan: women and the young. Among the 800 civilians killed and 1,600 wounded in May and June, about half were women and children, according to the United Nations.

One attack on another girl’s school in Kabul in May killed more than 85 people, many of them girls.

The Best Friends Group said Afghanistan can’t go back in time to burqas and women sealed away from modern society. And as the Afghan security forces lose more villages and cities to the Taliban, Zarghoona’s Class of 2021 and their mentors consider them one of the last and best hopes for the future.

“These girls are very talented, skillful, wise and smart,” their principal, Nasrin Noorzai, said. “Young boys are fleeing the country. But girls remain.”

Belqees Niazi, 17

A drumbeat of explosions is a reality of life in Kabul, but Belqees and her classmates have grown more anxious recently.

An attack at Kabul University last year left 22 people dead, including students. In May, the attack at Syed Al-Shahda High School across town from Belqees’s school killed scores of girls who had just finished afternoon classes.

“Many people ask why you want to study when you get killed,” she said. She plans to become an architect, focused on constructing buildings even as some of them fall around her.

Her dreams have been fueled by the sacrifices of her father, who imports goods from neighboring countries, Belqees said. His success put two of her sisters in college. But lately, as the Taliban seal off border crossings and choke off trade, her family’s finances have suffered.

In her nightmares, militants surround Belqees and fire rocket-propelled grenades.

“The Taliban has greatly affected our morale. I cannot imagine living in the same conditions as my parents. I cannot even talk of it,” she said. “If the Taliban come back, Afghanistan will be pushed back to 100 years.”

Safia Hussain, 18

Safia’s parents did not flee Afghanistan during the civil war and Taliban rule. And now, more than two decades later, Safia will make weathering tough times a family tradition, she said.

The perseverance to stay is linked to her plan to attend college and become an economist, Safia said. There is broad concern, agonized about in cafes and university campuses, that the deepening refugee exodus will drain the country of the young and educated.

That would crush Afghanistan’s future, Safia warned, just as she hopes to rebuild what the conflict has already destroyed.

“From my childhood, I’ve been thinking of living here,” she said. “There is no solution in getting out. If we want to have a government free from corruption, we can build one.”

Yet the Taliban’s thrust into provincial capitals has worried Safia. If she stays, and the militants once again topple the government, her vision of strengthening the country’s economy could be obscured if forced to wear a burqa, she said.

What pulls her back from the brink of despair is the march of women to preserve and expand their rights, she said.

“The more you oppress women, the harder women will try to fight back,” Safia said. “We are ready to fight.”

Behishta Amini, 18

Behishta dreams of becoming an English translator, but in between lessons she worries about what has become of her father.

Behishta’s father worked as a truck driver, she said, and took other odd jobs to educate his three daughters and two sons. But her father’s mental health declined when she was in first grade, Behishta said, amid the pressure of raising a family on a modest salary during a roiling insurgency.

“He lost his memories and went missing,” Behishta said. Her eyes welled with tears. Belqees and Safia wrapped her in their arms. “I don’t know where he is now.”

Taliban militants have been somewhat an abstraction to Behishta for years, pushed to the fringes in the outer provinces as they battled coalition and Afghan security forces. But their rule before she was born has become its own history lessons, now amplified as her classmates dread a return to subservience.

“I don’t know if I can continue my education or not,” she said. “If men can fight the Taliban by guns and artillery, we women can defend ourselves through our thinking — and not give in.”

Read more: