Inside the Fall of Kabul: An On-the-Ground Account

Default Headline


photophotophotophoto

Jim Huylebroek for The New York Times

As the U.S. withdrawal approached, analysts thought it would be months before the Taliban brought the fight to Kabul.

Instead, to the shock of the world, the Afghan capital fell in a matter of hours.

This is the story of why it happened and what came after — by a reporter and photographer who witnessed it all.

Inside the Fall of Kabul

Inside the Fall of Kabul

Against all predictions, the Taliban took the Afghan capital in a matter of hours. This is the story of why and what came after, by a reporter and photographer who witnessed it all.

Listen to This Article

Audio Recording by Audm

To hear more audio stories from publications like The New York Times, download Audm for iPhone or Android.

After dark on a mild July evening, I made my way through a heavily fortified neighborhood in downtown Kabul. Over the years, the capital’s elite had retreated deeper behind concrete walls topped with concertina wire; sometimes they even added a layer of Hesco barriers on the sidewalk, forcing me into the street as I passed. I buzzed at the home of a former government official, went inside and climbed the marble stairs to a rooftop party. I’d been to a few of his gatherings over the years, some of them raucous with laughter and dancing, but this was a quiet affair, with a small group of Afghan men and women, mostly young and stylishly dressed, sitting in a circle under the lamplight.

The mood was grim. In recent weeks, large areas of the north, places that had not historically supported the Taliban, had suddenly fallen. A new assessment by the U.S. intelligence community predicted that the republic could collapse as soon as six months after the last American forces left. Yet President Biden was pressing ahead with the withdrawal. That very night, American troops were flying out of Bagram Air Field, the giant base north of the capital where the United States had built a prison to house detainees.

I greeted the guests in Persian, and when I was introduced by the host as a foreign journalist, they fell silent. “Tell us what you think is going to happen to Afghanistan,” a young woman said, turning to me. She added sarcastically, “We’ve probably said the same things already, but we believe them when we hear them from a foreigner.”

A park in Kabul in July.

Like many people in Washington and Kabul, I thought six months was overly pessimistic. The government had a considerable advantage in men, weapons and equipment, and it still held the cities. Surely, I said, Afghanistan’s power brokers, fractious and corrupt as they were, would unite and rally their forces for their own survival.

As civilians, the guests at the party faced a stark question that summer, which they repeated to me: Berim ya bashim? Should we stay or should we go? Afghans had endured the agony of displacement and exile for 40 years; the latest wave began in 2014 at the end of the U.S. troop surge, which was followed by an economic recession and the steady loss of territory to the Taliban. The following year, when Europe’s borders collapsed and a million people crossed the Mediterranean in boats, Afghans were the second-largest group among them, after Syrians.

But the people at this party weren’t likely to cross the mountains or sea with smugglers. Some had studied abroad and returned; others had no intention of leaving, like Zaki Daryabi, publisher of the scrappy independent paper Etilaat-e Roz, which had become known for exposing corruption within the administration of President Ashraf Ghani. Some were waiting for a chance to leave legally, with dignity, for work or school. Yet opportunities for Afghans were rare; they had the worst passports in the world when it came to travel without a visa. Now they were faced with the prospect of becoming refugees.

“I have seven visas in my passport — I can leave,” an older Afghan businessman said. “What about the guy who has no chance, who just has a little house and a little shop?”

“One of them’s me,” Zaki said as he stood up for refreshments. He tapped himself on the chest and grinned ruefully. “One of them’s me.”

The Taliban were advancing on the capital, but the prospect of a peace deal frightened many of the guests, as much as the continuation of the war, which had mostly afflicted the countryside. At the insistence of the United States, negotiations between the government and the Taliban were underway in Doha, and a power-sharing agreement that would bring the Taliban to Kabul was seen as a disaster by the urban groups that had benefited from the republic’s relative liberalism and international support, particularly working women.

At the insistence of the guests, a young poet, Ramin Mazhar, stood to read. Slender and stooped, Ramin had a gentle manner that belied his ferocious iconoclasm. Many of his poems, which he posted on Instagram, could be considered blasphemous by fundamentalists. I asked him earlier whether he had published any printed volumes. “No,” he said, smiling. “They’d kill me.”

He recited several of his poems; one, set to music by a singer named Ghawgha Taban, had become an anthem for Kabul’s progressives. After Ramin was finished reading, someone put the song on the stereo, and the guests sang along from the rooftop, their voices growing louder:

You are pious, your kisses are your prayer.
You are different, your kisses are your protest.
You are not afraid of love, of hope, of tomorrow.
I kiss you amid the Taliban, you are not afraid!

The day before, I went to see Rangina Hamidi, Afghanistan’s acting minister of education, at her home in Kabul. We were in the midst of the coronavirus pandemic’s third wave, which had filled the hospitals with gasping patients, and the government had closed schools in response; Rangina herself was still recovering from an earlier bout with the virus. She coughed a little as she greeted me on the lawn, where her daughter’s pet goat, Vinegar, stood watching us.

“I’m still having trouble with my memory,” she told me. There were gaps in the lost year. Rangina had returned to work at the ministry, but she felt isolated, part of a political class confined to guarded compounds and armored cars.

In the living room, I embraced her husband, Abdullah, and marveled at how tall their daughter, Zara, who was in fifth grade, had gotten. She was just a baby when I met the family almost a decade ago in Kandahar, the Pashtun heartland that was the birthplace of the Taliban. I used to visit their home during my reporting trips there. I admired Rangina’s ability to bridge two worlds, as a driven entrepreneur who founded a handicraft collective and a woman enmeshed in the social life of Kandahar, one of the most gender-segregated cultures on the planet.

There were few women like Rangina in high office. She was born in Kandahar, but her family, escaping the Communist regime, had gone to the United States as refugees in the 1980s, when Rangina was a child. She majored in women’s studies and religion at the University of Virginia and considered herself a proud feminist; that was also when she chose to start wearing the hijab, which strengthened her connection to her faith.

Her father, Ghulam Haider, an accountant by trade, raised her to pursue the same opportunities in life as a man. He was her hero growing up. When she moved back in 2003 to help in the reconstruction of their country, he was inspired to follow her. At first, they were full of hope. She met Abdullah, an engineer, and founded the handicrafts cooperative; her father became Kandahar’s mayor as the streets filled with American soldiers and the war intensified. In 2011, he was assassinated by a suicide bomber.

We sat down for dinner around a tablecloth spread on the carpet, and Rangina heaped my plate with samosas. “Thank you, Madam Minister,” I teased, and we laughed. She told us the story of how she ended up in the cabinet. Four years earlier, she moved to Kabul after a friend recruited her as the first principal of Mezan, a coed private school that offered an international English curriculum. After a couple of years, the school’s success had attracted the capital’s elite. That, she believed, was why she received a call last year from the president. She thought Ghani wanted to know about Mezan’s online learning programs for the pandemic; instead, he asked her to become his minister of education. Shocked, she asked for time to think.

Until then, Rangina had resisted joining the Afghan government; it was dominated by warlords who, she believed, were responsible for killing her father, more so than the Taliban. Those who took part became corrupt themselves, or else were hounded into leaving. But Rangina had long admired Ghani, who as minister of finance in the early years of the republic acquired a reputation as a brilliant technocrat, arrogant but personally incorruptible. When she met him in person at the palace, she was enthralled by his intellect and his vision for reform — a true patriot, she thought. Even his infamous temper reminded her of her father, who didn’t suffer fools.

Praising her work at Mezan, Ghani told her he wanted someone who could help him modernize Afghanistan’s outdated curriculum. Rangina believed that the cultural gap that had grown between the cities and the countryside could be bridged by marrying a traditional version of Islam — one that drew on great Afghan scholars like the poet Rumi — to contemporary teaching practices. When she said yes, she became Afghanistan’s first female education minister since the Communists, who brought radical new opportunities for women to go to school and work in the cities, gains that were wiped out after they were overthrown by American-backed Islamists in 1992. The Taliban, who took power four years later, instituted a ban on girls’ education after puberty. As a result of the American invasion in 2001, an entire generation of Afghan girls had gone to schools and worked at jobs that had been denied to their mothers — an entanglement between the military presence and women’s rights symbolized by a mural outside the U.S. Embassy depicting the girls’ robotics team alongside the American flag.

With American troops finally leaving, that progress was now at risk. In many areas controlled by the Taliban, which they called the Islamic Emirate, girls were only allowed to attend school until sixth grade, which Rangina’s daughter would enter next year.

The American withdrawal that had brought the republic to the brink of collapse began in February 2020. That month, the chief negotiator for the United States, Zalmay Khalilzad, dressed in a navy suit, sat at a table in Doha, Qatar, beside his turbaned Taliban counterpart, Mullah Abdul Ghani Baradar, signing copies of a document titled “The Agreement for Bringing Peace to Afghanistan.” President Donald Trump, who came into office intent on ending the United States’ longest war, had appointed Khalilzad, an Afghan-born, naturalized U.S. citizen who previously served as ambassador in Kabul.

Afghan government officials were notably absent from the table in Doha — the Taliban had long refused to negotiate with what they considered a puppet regime. But, as a result of the deal, in exchange for U.S. troops being out within 14 months, the Taliban agreed to talks with the republic. Khalilzad and his team had hoped to make the final U.S. withdrawal conditional on peace between the Afghans, but Trump insisted on sticking to the timeline.

Now the vast gulf between republic and emirate had to be bridged. Khalilzad and his team, who believed that Baradar’s side was genuinely interested in reaching a deal, proposed a power-sharing arrangement led by someone “acceptable to both sides” — a definition sure to exclude Ghani. “He hated that, because it means that he has to go,” Khalilzad said of the Afghan president, whom he had known since they were boys. “I didn’t see another way.”

Ghani insisted that he would hand over power only to an elected successor. (He declined to respond to questions.) He proposed a caretaker government and new elections overseen by himself, a nonstarter for the Taliban. But Baradar and his team never offered a concrete counterproposal of their own, insisting instead on a prisoner exchange. Some believed that the Islamists were simply running out the clock until the U.S. forces left.

“The Taliban were not serious about peace,” said Matin Bek, a senior official on the negotiating team. True power within the movement, he thought, resided not with Baradar’s group in Doha but with the military commanders on the ground and the senior leadership hiding in Pakistan. It seemed clear to Bek that the rebels wanted to see if the government could survive on its own before they would accept anything short of outright victory. “If we could put up resistance and stand without the Americans, only then would they enter into real negotiations.”

As the withdrawal progressed and the Taliban gained strength on the battlefield, Ghani grew isolated; allies deserted his government, some with an eye to Khalilzad’s proposed power-sharing arrangement. And so the president came to rely on a shrinking core of trusted aides, who encouraged him to fight the Taliban. Foremost among them was Hamdullah Mohib, the president’s right hand and heir apparent, who, as the national security adviser, controlled much of the information about the war that was presented to the president.

When Ghani selected Mohib to lead the office of the National Security Council in 2018, he had no military or security experience. He had studied computer systems engineering in Britain, where he emigrated as a teenager. In 2009, Mohib helped with Ghani’s first, unsuccessful bid for president, running his website. Five years later, Mohib again volunteered for Ghani, who emerged as the improbable victor from a crowded field, though the disputed result had to be brokered by the United States amid evidence of fraud on all sides. In the West, Ghani was hailed by many as an educated reformer, co-author of the book “Fixing Failed States.”

With Ghani in the palace, Mohib’s rise to power began. The following year, at age 32, he was sent to Washington as Ghani’s ambassador. I got to know him in those days; easygoing and approachable, he seemed successful at the networking the job required, as he lobbied for U.S. support for the war effort. Three years later, Ghani brought him home to coordinate security policy, providing him a house next to his own on the palace grounds; their wives became close, and Mohib’s young children played with the president, who was old enough to be their grandfather.

But Mohib quickly ran into trouble in his new role. As tensions grew between Kabul and Washington over Trump’s plans for withdrawal, Mohib lashed out publicly against Khalilzad, accusing him of seeking personal power as a “viceroy.” Outraged, the Americans froze Mohib out of meetings for a year, and many expected him to lose his job, but the president stuck with him. Eventually, Khalilzad told me, he forgave Mohib at Ghani’s personal request.

Mohib’s team, like much of the Ghani administration, attracted a young cadre that reflected the president’s technocratic values. Favoring tailored suits and speaking excellent English, many were raised or educated abroad, a type that some referred to as “Tommies,” after the brand Tommy Hilfiger. “Young, educated, well-spoken, corrupt,” said Sibghat Ghaznawi, a doctor who had been a Fulbright scholar in the United States with many of them. He said those who succeeded in the palace tended to excel in chappalasi, or brown-nosing, and telling their superiors what they wanted to hear. Last year, when Sibghat became a senior adviser to the office of the National Security Council, he said that Mohib warned him not to be too negative with the president. He already knows these things, Mohib told him, so you don’t need to be reporting what he already knows.

In Afghanistan, the causes of state weakness preceded the Ghani administration and went deeper than any particular individuals: a 40-year civil war fueled by foreign superpowers, malignant corruption and the Pakistani military’s covert support for the Taliban. Above all, the U.S. occupation had created a state dependent on American troops and foreign money. As the republic entered a downward spiral, Ghani and his team struggled to consolidate their authority, alienating many who supported the republic. “They were always scared that if a potential deal happens between negotiators, they might be pushed out,” Bek said.

Last year, for instance, Ghani ordered Mohib and the security council to review all district police chiefs and governors; ultimately, they replaced a majority, more than 200 of each, in what was seen as a damaging move in the middle of intensifying violence, one that sidelined local commanders. “The Taliban seized this moment and made peace with those people,” Bek said.

The Islamic Emirate understood a basic lesson from Afghan history, which was that the nation’s wars have often ended with individual commanders switching sides; that was how the Taliban rose to power in the 1990s and how they were defeated in just several weeks in 2001. After they signed a deal with the Americans in Doha, the Taliban promoted a policy of afwa, or amnesty, privately reaching out to power brokers with a clear message: The Americans are leaving, the republic is falling, but the Emirate will forgive those who surrender.

In this battle for hearts and minds, the government’s answer was its psychological-warfare program, overseen by Mohib and the security council. For years, the United States and its allies had funded psy-ops for the Afghan forces, spending heavily on advertising with the local news media. According to Afghan officials, the intelligence service, the National Directorate of Security, also made covert payments to Afghan journalists and civil society in exchange for their support. Another initiative was the creation of thousands of fake accounts on Facebook and Twitter dedicated to promoting the government and attacking its critics, work known by the Pashto term Facebookchalawonky.

But these messages did not spread much beyond the bubble world of the Kabul elite, where civil society had largely moved online, as demonstrations and events were targeted by terrorist attacks. Afghanistan’s vibrant cyberspace must have been attractive to officials cloistered within blast walls and armored cars, but it failed to capture the reality of the countryside, where only a fraction of the population had access to the internet.

Sibghat, the adviser to the security council, told me that he was surprised how often social media was cited as evidence during meetings, where many made arguments that he considered demonstrably false: that the Taliban were militarily weak, and it was simply that no one was taking proper action against them. That the insurgents could never act independently from Pakistan. Above all, he said, many working for the council clung to the belief that the United States would never leave Afghanistan. There was simply too much at stake: counterterrorism, regional power, precious minerals. “They’re not so stupid to have spent that money here and then leave,” was how Sibghat characterized the prevailing view.

Bek and other officials also told me that there was a persistent belief within the government that the United States would remain, particularly after Biden defeated Trump. In fairness, there was hope within the U.S. establishment too; in February, a bipartisan group set up by Congress recommended making the withdrawal conditional on peace between Afghan parties — a move that the Taliban said they would react to by resuming attacks on U.S. forces.

Biden and his staff felt that they had been put in an untenable position by his predecessor; there were only 2,500 troops left in Afghanistan, so staying and fighting would have required a new surge. In April, Biden announced that U.S. troops would be out by Sept. 11. “We will not conduct a hasty rush to the exit,” the president said. “We’ll do it responsibly, deliberately and safely.” Mohib, who answered written queries, told me he knew the Americans would leave: “We were planning for their departure.” He said that what they consistently asked for was a “gradual and responsible withdrawal” that would allow Afghan forces to adjust. “We never got that.”

On July 15, I went to the palace to see Mohib. Above the gate tower, a giant tricolor of the republic fluttered against a clear blue sky. After passing through security, I walked across the long, deserted lawn toward the building that held the Office of the National Security Council. I waited in the council’s empty reception room until one of Mohib’s staff members, a young woman who had studied in America, brought me upstairs to his office, where he sat behind his desk. Our conversation was mostly off the record. He seemed exhausted as we spoke about the desperate fighting in Kandahar City, which had been surrounded by the Taliban.

Only a few days before, there had been a farewell ceremony for Gen. Austin S. Miller, the long-serving U.S. commander. The military had completed 90 percent of its withdrawal, well ahead of Biden’s deadline. This rapid pace was intended to reduce the risk of attack during the retreat, but it had a devastating impact on Afghan security forces. The U.S. military had spent billions to train and equip a force in its own image, heavily dependent on foreign contractors and air support. But the Afghan Army’s notoriously corrupt generals stole their men’s ammunition, food and wages; while security forces were supposed to total 300,000, the real number was likely less than a third of that. Out in the districts, the army and the police were crumbling, handing over their arms to the Taliban, who now controlled a quarter of the country.

Ghani had repeatedly insisted that he would stand and fight. “This is my home and my grave,” he thundered in a speech earlier in the spring. His vice president, Amrullah Saleh, and the security council were working on a post-American strategy called Kaf, a Dari word meaning “base” or “floor,” which envisioned garrison cities connected by corridors held by the army and bolstered by militias, similar to how President Mohammad Najibullah clung to power for three years after the Soviet withdrawal. “It was very much the Russian model,” said Bek, who returned to the government as the president’s chief of staff that month. “They had a good plan on paper, but for this to work, you needed to be a military genius.”

Earlier in July, Ghani was warned that only two out of seven army corps were still functional, according to a senior Afghan official. Desperate for forces to protect Kandahar City, the president pleaded with the C.I.A. to use the paramilitary army formerly known as counterterrorism pursuit teams, according to Afghan officials. Trained for night raids and clandestine missions in the borderlands, the units had grown into capable light infantry, thousands strong. They were now officially part of the Afghan intelligence service and were known as Zero Units, after codes that corresponded to provinces: 01 was Kabul, 03 was Kandahar and so forth. But according to the officials, the C.I.A. still paid the salaries of these strike forces and had to consent to Ghani’s request for them to defend Kandahar City that month. (A U.S. official stated that the units were under Afghan control; the C.I.A. declined to comment on details of their deployment.) “They’re very effective units, motivated, cheap,” Mohib told me in his office, saying Kandahar would have fallen without them. “They don’t need all sorts of heavy equipment. I wish we had more like them.”

But the Zero Units had a reputation for ruthlessness in battle; both journalists and Human Rights Watch have referred to them as “death squads” — allegations that the C.I.A. denied, saying they were the result of Taliban propaganda. I had been trying to track these shadowy units for years and was surprised to see them, in their distinctive tiger stripes, given glowing coverage on the government’s social media accounts.

In Kabul, I met with Mohammad, an officer from one of the N.D.S. units that operated around the capital, whom I had known for a few years. Mohammad had worked as an interpreter for the unit’s American advisers and as an instructor for undercover teams that carried out arrests inside the cities. He said morale had plummeted among his men, now that the Americans were leaving. According to Afghan officials, the station on Ariana Square was empty by late July. But Mohammad’s team still received advice from the Americans. He showed me messages that he said were from the C.I.A., urging his unit to patrol areas around Kabul that had been infiltrated by the insurgents. “The airport is still in danger,” one message said.

The bubble world did not survive on psychological repression alone. At the end of June, I had visited an Afghan journalist named Shershah Nawabi at the office of his small news agency, Pasbanan. A group of young men and women sat at computers in the sparsely furnished office, guzzling energy drinks.

“Here, take this, I can’t publish it,” Nawabi said, handing me the draft of an article titled, in Persian, “Latest Report: 98% of Government Officials’ Families Live Outside Afghanistan.”

The story listed the countries where the families of the Ghani administration were living, from the president — whose children grew up in the United States — on down. Out of 27 cabinet ministers, it claimed, only two had families who resided in Afghanistan full time. “In the event of a crisis in the country,” Shershah had written, “all government officials will consider fleeing.”

He had been leaked the information by sources inside the government. “I made a mistake,” he said. “I called them to try to verify the info.” The N.D.S. got wind, and one of his contacts at the intelligence service warned him not to endanger himself and his staff by publishing it.

It was clear that the consequences could be severe. There was growing concern in the international community that the Afghan republic was stepping up pressure on dissidents, especially after Waheed Muzhdah, a prominent commentator, was mysteriously assassinated at the end of 2019, an attack that many blamed on the government.

On July 11, Hedayatullah Pakteen, a young university professor who had been part of Muzhdah’s circle, was arrested at his home by intelligence agents and held for seven nights. He said he was hung by his wrists and beaten repeatedly, in an attempt to get him to implicate several others who were accused of links with the Taliban. He was freed after a campaign from his friends in the media; he said he was forced to sign a document promising that he wouldn’t give interviews anymore. His friend Abdul Ghafar Kamyab, a defense lawyer known for taking the cases of people accused of being Taliban, was snatched from the center of Kabul and was missing for more than 40 days; he told me he was tortured severely, including with electric shocks.

According to Sibghat, the adviser to the office of the National Security Council, during the previous year he had participated in discussions about a group of lawyers and professors, former friends of Muzhdah, who called themselves peace activists. Sibghat told me that some officials had argued that they were Taliban sympathizers who should be arrested and “squeezed,” which Sibghat understood as a euphemism for torture, until they agreed to stop speaking to the news media. Sibghat said he argued against it, pointing out that the Communists had used such methods and failed; Mohib, as was his habit, remained aloof without saying anything definite.

Torture had long been common in the republic’s prisons, as documented since 2011 by the United Nations. The U.N.’s biannual reports cataloged a list of methods that included waterboarding and sexual assault, much of it carried out by the N.D.S., which was advised by the C.I.A. and British intelligence (both agencies have denied any involvement with torture). That July, according to Afghan officials, the British had gone to the government to protest the existence of an N.D.S. “hit list”; the Afghans fired two senior intelligence officials as a result. (The British government declined to comment.)

But as much as Kabul’s journalists feared violence at the hands of the government, some worried that if the republic fell, worse would follow. At the end of July, I visited Zaki, the publisher I met at the rooftop party, to see how he was faring. We sat upstairs in the office of Etilaat-e Roz, cups of green tea and a packet of thin Esse cigarettes between us. “So what do you think is going to happen?” he asked with a smile.

Zaki was slight, with delicate features; he and most of his staff were Hazara, a historically oppressed Shia minority. He hadn’t studied or lived abroad; he came from his village to Kabul for college and had founded his newspaper with a loan from friends. Over the last 10 years, Etilaat-e Roz had slowly grown, scraping by with ad sales and subscriptions, resisting emoluments from powerful sponsors. It finally attracted foreign grants from places like the Open Society Foundations and had become known for its bold exposés of corruption in the government.

But with the system disintegrating, Zaki said that he had been thinking about the role of the gadfly differently. Criticism, like objectivity, made sense only within a shared set of values. “If we’re talking political philosophy, and the question of a republic versus an emirate, well, that’s different,” he told me. “We’re liberals. We believe in freedom and democracy.”

The entire order had been dependent on foreign money, which created space for progressives like Zaki. But opposition to liberalism, or what was labeled “Westernization,” was not confined to the Taliban. A broad streak of political Islamism cut across Afghan society; even among Hazaras, there were reactionary clerics who would have been happy to lash Zaki and the other men and women who hung out in the cafes near the office. Even under a power-sharing agreement, Zaki feared that freedom of the press and women’s rights would be the first areas of compromise. But Etilaat-e Roz was his young life’s work, his fourth child. Of course it was his other three children who made the choice to stay so difficult.

“Some of us have no choice but to keep doing this, because of what we believe,” Zaki told me, with his rueful smile. He was going to remain as long as it was possible to do his work, as long as some foothold remained in the capital, however narrow, above the abyss that was opening. “We’re working as if Kabul won’t fall,” he said. “If Kabul falls, Etilaat-e Roz will fall, too.”

The republic’s accelerating collapse, which had begun in the rural areas, soon reached the towns and district centers, and finally the cities. On Aug. 6, Zaranj, the capital of Nimruz, became the first provincial center to fall to the Taliban. Nader Nadery, a member of the republic’s negotiating team from Nimruz, was called for a meeting with the president; he told Ghani that several of his relatives had been killed there. “I said that things are falling apart, the chain of command is broken and people are not telling the truth to you,” Nadery told me. “He answered, ‘Yes, it will take another six months for us to turn it around.’” Stunned, Nadery left the palace wondering what kind of information the president was getting.

The day after Nimruz, a second capital, Sheberghan, fell. The next day, three capitals fell in the north: Sar-i-Pul, Takhar and Kunduz.

That evening, I went to see Rangina. Zara’s goat, Vinegar, which cried incessantly when left alone, had been taken into the guard shed for the night. I sat with Rangina and Abdullah, discussing the rumors of martial law circulating in the capital. Behind Rangina, I could see the reflection of the television in the window as the evening news played images of burning buildings, refugees, soldiers promising to die for their country. There were increasingly strident assertions about what a Taliban takeover would mean: stories about the forced marriage of young girls and widows to their fighters, even sex slavery. It would mean a return to the brutal days when men without beards were flogged in the streets, when women were not allowed to leave the home without a guardian, of public executions in soccer stadiums, of stoning and amputations, a massacre for everyone who had worked for the foreigners, a genocide for Afghanistan’s Hazara minority.

In the past, these kinds of statements had always been followed by a “therefore”: Therefore, America must not leave Afghanistan. Therefore, the war should continue. Now they were bleak predictions.

Rangina was frightened; the defense minister’s home was blown up just a few days earlier. But she was also skeptical about some of the claims of Taliban savagery; she told me about how the staff at a local education ministry in a recently captured province had posed for a photo with their new Taliban boss, seemingly unharmed.

I had been planning to travel to the south for research, and I thought I might stay at the office of Rangina’s cooperative, Kandahar Treasure. “Are you sure you want to go now?” she asked.

I didn’t understand how quickly things were falling apart; maybe I was in denial, too. I went to Hamid Karzai International Airport three days later, on the morning of Aug. 11. It was busier than I had ever seen it, a crush of passengers headed for the international terminal. The domestic side was quiet and tense. There were flights to the main cities of Herat and Mazar-i-Sharif, where, like Kandahar, battles were raging as the Taliban laid siege.

I went through security and sat in the boarding lounge, but I couldn’t get in touch with the fixer who was supposed to pick me up in Kandahar. I couldn’t get in touch with anyone there, in fact. Finally, a journalist friend called using the internet at the military base at the airport there. The Taliban had shut down the mobile networks in preparation for an all-out assault.

I got up and walked back out through security. The airline staff chased me down.

“I’m leaving,” I said. “My trip has been canceled.”

“Why?” They stared at me suspiciously.

“Because the phone networks are down. My office won’t let me go.”

I waited as they took a picture of my boarding pass and passport.

“He’s the third person to cancel like this,” one woman whispered anxiously.

When I got my documents back, I walked out against the flow of Afghans leaving their country. In the parking lot, there were groups of families, some crying and some silent, people in their Western outfits for travel, suits and T-shirts, girls with big up-dos and painted faces, matrons taking photos, men in turbans and karakul hats and prayer caps, the families embracing and then dividing, one part walking away, the others left watching.

The next day, Kandahar City fell.

For months, American leaders had been reassuring the Afghans that the military withdrawal did not the mean the end of U.S. engagement. Even after the last troops left on Aug. 31, a 650-strong security force was supposed to remain behind to protect the massive embassy complex. And with the U.S. Embassy remaining, other Western organizations were more likely to stay, too, and supplies and financial aid would continue to flow to the republic.

But now the rebels were advancing as fast as their motorcycles could carry them. On Thursday, Aug. 12, the city of Herat fell, and the Taliban captured Ghazni, 70 miles southwest of the capital. The Taliban had promised not to harm embassies and international groups, but the specter of the terrorist attack in Benghazi that killed U.S. diplomats in 2012 hung over the Biden administration. If even a single American was harmed, how could the Democrats defend having trusted the Taliban?

On Thursday, Biden ordered the embassy to shut down, and diplomats began destroying classified materials and shifting operations to the airport, where 3,000 U.S. soldiers and Marines were being flown in to evacuate American citizens and their allies.

The Taliban would soon be at the gates. Could Kabul be defended? In theory, the capital boasted an impressive force: tens of thousands of soldiers and police officers, among them the country’s most elite units. But even if Kabul could be held, Ghani seemed to have finally accepted that the war was lost and had opened secret talks with the Taliban. According to Afghan officials and U.S. diplomats, his envoy in Doha, Abdul Salam Rahimi, had been developing a back channel to the movement’s leadership — not only to Baradar, the chief negotiator, but to the two powerful military deputies, Sirajuddin Haqqani and Mawlawi Yaqoub, son of the deceased leader Mullah Omar. The Taliban said they did not want to fight a bloody battle for Kabul, one that could mean the destruction of its banks and embassies and nongovernmental organizations, of its institutions, of the entire system.

On Thursday, the same day that Biden ordered the embassy to close, Rahimi, who had recently come back from Qatar, met with Ghani and Mohib and explained the proposal he had worked out with the Taliban, according to the officials. It was, in essence, a negotiated surrender; the Taliban would agree to a two-week cease-fire so that a delegation from Kabul could travel to Doha and work out the details of a transitional government. The Taliban would be in charge, but their rule would be “inclusive,” which meant some republic officials might take part. Ghani would call a loya jirga, a gathering of notables, who would approve the deal. Then Ghani would resign and hand over power to the jirga, who would ask the Taliban to form a government.

Immediately after the meeting, Khalilzad’s team in Doha, which had been in the loop about the back channel, received two calls. The first was from Rahimi, explaining that Ghani had agreed to the deal and was prepared to step down. (Rahimi did not respond to a request for comment.) The second was from Mohib. According to a U.S. diplomat involved in the negotiations, Mohib described the meeting in more conditional terms: Ghani would agree, but only if he was certain that his terms were being met. (Mohib denied this, claiming that he made “no reference” to Rahimi’s discussions.)

That night, seeking clarity on Ghani’s intentions, Antony Blinken, the U.S. secretary of state, spoke with him by video conference. According to the U.S. diplomat, Ghani said he would agree to the deal, to Blinken’s relief. He was prepared to resign.

“It was closer to Rahimi’s version than Mohib’s,” the diplomat said. Now the Afghans needed to carry out the peaceful transfer of power; they had, in theory, two weeks until the Americans left the airport, during which time the Taliban were supposed to remain outside the city.

The fate of the capital’s millions of inhabitants hung in the balance.

On Friday, Aug. 13, Kabul’s residents awoke to news of the American evacuation. It was the Islamic day of rest. Though the Taliban were advancing, they still hadn’t reached the nearest cities, and Kabul’s streets were quiet as I drove to visit Rangina. She had invited me for lunch, and I found her in the hall by the kitchen, her sleeves rolled up, scraping out pumpkins alongside the cook. She cleaned up and joined her husband and me; she said she had just turned down a request from the National Security Council to turn the schools into shelters for refugees. “They just reopened the schools, and now you want me to close them?” she said. “If you want to do that, then declare martial law and do it.”

People from neighboring districts were pouring into the capital, fleeing ahead of the Taliban, who the U.S. Embassy had warned were committing war crimes. Given Afghanistan’s bloody history, they had reason to be fearful. In 1992, after the Communist government collapsed, the mujahedeen tore the capital apart fighting one another. Four years later, the Taliban hung the former president, Najibullah, and brandished whips against those who played music or shaved their beards. And in 2001, the United States and its warlord allies had hunted down the vanquished Taliban around the country; some were shipped off to detention centers and tortured. Now many were certain that despite their promise of amnesty, the Taliban would take revenge.

Rangina was getting calls from friends and relatives in the United States, telling her to flee before it was too late. “How many of us are you going to save?” she asked. “Thirty-five million? And then live with shame for the rest of my life? Because I had the American passport in my pocket, and I could just leave.”

Her phone rang, and she answered on speaker. It was an employee from her cooperative in Kandahar City, who said that one of his relatives, a former police officer, had been pulled from his home by Taliban fighters and shot.

“Allah!” Rangina exclaimed.

“Be careful, be careful,” Abdullah told him.

“We don’t know what the hell is going to happen,” Rangina said, after they hung up. We looked out the window, to where Zara was playing on the lawn with four other girls. Only one had an American passport. Rangina’s mother, who is in the United States, had begged her to send Zara there, if she and Abdullah were too stubborn to leave. Rangina was considering it.

“This guy doesn’t agree with me,” she said, turning to her husband. “Unless he’s changed his mind, I don’t know. Have you? You want her here? And if these wild animals come and, God forbid. … ”

We looked at Abdullah, who was silent for a moment, as if some memory was stirring in him. He was older than Rangina. He had fought the Russians, lived through three regime changes, seen bodies in the streets and homes gutted by looting. And he knew how vicious the Taliban had been with their opponents in the 1990s. He was ready to give his life to protect his wife and daughter; he also knew that might not be enough. But he didn’t want Rangina and Zara to be separated. “Then you leave, too,” he said.

“I’m not leaving,” Rangina replied.

That night, I went to a farewell party in the Green Zone, on the same blocked-off street as the Canadian and British Embassies. Many of the foreign nationals based in Kabul left the country during the pandemic to work remotely, but the few who remained had been as surprised as everyone by the sudden collapse of the government. As we gathered on the front lawn of an NGO guesthouse, gorging on hoarded wines and whiskey, some were in tears, while others danced manically.

The decision of the U.S. Embassy to pull out meant that most other Western organizations were evacuating, too, although the embassies of Iran, Russia and China — America’s rivals — were going to remain. As a rumor spread at the party that the U.S. military would shut down commercial flights at the airport in a few days, people got on their phones and tried to rebook; most tickets were sold out.

Afterward, a friend persuaded me to go with him to another party at a senior Afghan official’s house, someone close to Ghani. I’d been there a couple times. It was a blast-walled compound with AstroTurf in the yard, mirrors on the walls, exotic pets and a bountiful liquor cabinet. Once we got past the guards, we found just a few people sitting around, glued to their phones. I sat next to the official, who liked to D.J. at parties.

“Three thousand troops are coming, you think that will change anything?” he said. He showed me a message on his phone. “This is info from the TB side. They’ll take 17 provinces, in a power-sharing deal with the government.”

That was roughly half of the country. “I don’t think they’d settle for less than total control now,” I said.

He shook his head angrily. “No, they’ll realize if they take it all, the Americans might come with a hundred thousand troops,” he said. He tapped his head. “They’re rational. They have advisers from Pakistan, from China, from Russia. You think these guys with the long beards are making decisions?”

Ghani had banned senior officials from leaving the country, but the day after the party, my host made it out through the airport, accompanied by a relative of the president.

On Saturday, Aug. 14, the start of the workweek, the streets of downtown Kabul were in a frenzy, crowded with people running desperate errands. Some were trying to obtain passports or plane tickets, while others stood in long lines outside the banks. There was a shortage of cash. The value of the afghani had dropped suddenly; people wanted dollars.

Early that morning, I went for a jog in the park by my house and found it crowded with displaced families in tents, the air thick with cooking smoke and the stench of the outdoor toilets. Taxis and vans loaded with mattresses and a few household goods rolled up, and people piled out, seeking what free space was available.

I was busy that day with my own errands, like finding a satellite phone, even though for months I’d been making contingency plans with my housemate, Jim Huylebroek, a Belgian photographer. We’d talked through various scenarios for the fall of the capital, at first with the idle enthusiasm of preppers, and then with growing earnestness. Would there be a breakdown in communications? Martial law, house-to-house fighting, abductions? Riots and looting?

The New York Times, like most Western media organizations, was preparing to evacuate its staff. But Jim and I were both freelancers, so we could choose to stay. I had been watching what happened when the Taliban captured the cities of Herat and Kandahar. There was some violence, but there were no massacres, no executions of captured officials; the movement seemed to have control over its fighters. Now that they would govern, it was in the Emirate’s own interest, I thought, to stick to its promises, especially when it came to foreigners.

What I feared most was a chaotic interregnum before the Taliban could establish control, in a city filled with armed men. We might have to hole up in our house, which had solar power and was well fortified with bars on the windows; Jim and I stockpiled everything from canned goods to buckshot.

That afternoon, Ghani called a meeting at the palace, a gathering of the country’s most powerful men. The former president, Hamid Karzai, sat in a semicircle with leaders of the mujahedeen, former Communists, contracting barons — men who were handed power by the Americans in 2001, when their enemies, the Taliban, seemed utterly defeated. They had presided over two decades of plenty, when a rain of billions from abroad had enriched a minority, even as poverty among the people had grown. Now they faced the ruin of the republic.

Mohib was there, but the bellicose vice president, Saleh, wasn’t — the daily Kabul security meeting he normally led had been canceled that morning because of his absence, one participant said, though no one made much of it at the time. Ghani asked the others what they had to say. Karzai spoke of his fears for families like his own, who, he pointedly noted, were still in Kabul. The time had come for painful sacrifices, Karzai said, but he did not explicitly call on Ghani to resign. His point seemed clear enough, and it was echoed by the others, who pleaded with the president to avoid bloodshed and destruction in the capital.

If Ghani had in fact agreed to a deal with the Taliban through Rahimi’s back channel, then the meeting was mostly political theater. But Ghani didn’t explain the details, whether out of caution or pride, or because he still hadn’t decided if he would go through with it. He simply told the others that a delegation should go to Qatar immediately; he would accept whatever agreement they made with the Taliban.

The president left the meeting, and afterward, a group stood outside in consternation. Some, unaware of the secret talks, wondered if the president understood he had to resign. There was confusion over who would go to Doha. Mohammad Akram Khpalwak, an adviser to the president, was sent to ask Ghani, who answered that he would decide after he talked with the Americans.

That evening, Ghani met with the commander of U.S. forces and the acting ambassador to discuss the security plan for Kabul. The Americans promised to provide air support and surveillance. Then Ghani spoke by videoconference with Blinken. Again, according to the U.S. diplomat, they discussed the back channel for an orderly transfer of power to the Taliban.

By that night, Mazar-i-Sharif in northern Afghanistan had fallen, and the Taliban continued their rapid advance on the capital. The republic’s forces, utterly demoralized, were simply laying down their arms, allowing the rebels, after their long, lean years in the mountains, to take possession of billions of dollars worth of vehicles and weapons bought by the United States and its allies. The competition between commanders for booty and the prestige of being the first to conquer territory added momentum to the Taliban’s advance — as did rivalries within the movement. The Taliban leadership was largely from the south, especially Kandahar, but most of the insurgency around Kabul had fallen under the command of the Haqqanis, a family-led network of fighters from eastern Afghanistan that was close to the Pakistani military. Several months earlier, a senior figure, Khalil Haqqani, began making contact with Afghan officials, his former aide told me, paving the way for a push on Kabul from the east. The Taliban’s own psychological warfare was paying off: By now, cities were falling without a fight, surrendering after a mere phone call.

In the early hours of Sunday morning, the provincial governor of Nangarhar, the gateway to Kabul to the east, received his counterpart from the Emirate. Taliban fighters entered the city without firing a shot. As the sun rose, Haqqani sent a voice message congratulating the governor for handing over power peacefully: “You will have a place in history, for protecting the people’s lives and property.”

Taliban forces from Kandahar, meanwhile, hurriedly advanced north, toward Wardak Province, whose capital, only 10 miles from Kabul, fell around 10 o’clock on Sunday morning.

The road was now open to Kabul, where the police and the army were starting to desert their posts. Saleh, the vice president who had run security meetings for the capital, had secretly escaped to his home province of Panjshir, which helped throw the chain of command in Kabul into disarray. Local criminal gangs — many of them connected to the police — were waiting for their chance to start looting. At 9 that morning, when the police abandoned the station in District 7, near the king’s old palace, local gangsters, some dressed as Taliban in turbans, began to loot the station of weapons and other valuables, according to residents; they were joined by passers-by, who carried off computers and furniture.

By noon on Sunday, Aug. 15, Taliban fighters had reached the gates of the capital. The rebels gathered at the eastern and southern outskirts of the city on motorcycles and captured pickups, dusty and tired from the road, and waited.

Shortly before 10 o’clock that morning, the president sat in the shade of a courtyard at the palace, reading a book. He had met with Rahimi, who updated him on the back channel talks with the Taliban; that same morning, Khalilzad was meeting with Baradar in Doha to discuss the proposal for a peaceful transfer of power. Then Ghani met alone with Mohib, followed by a larger group including Bek, who said he suggested that the president call an emergency cabinet meeting in order to rally his officials. It was then that many learned that Saleh had escaped; the meeting never happened.

At 10 a.m., Khpalwak, the adviser, arrived in the courtyard, in order to find out who was supposed to travel to Doha to negotiate the handover. Karzai was sitting in his house next door, ready to leave that evening or the next morning on an Afghan charter flight. Khpalwak told me that Ghani said that Mohib should go to Doha, as well.

Jawed Kootwal, Khpalwak’s chief of staff, had snapped a photo of the president from his office window — Ghani’s frequent reading breaks had become a joke between him and his friends. Now Kootwal watched as his boss left and Mohib arrived with a man wearing a white robe and an Arab headdress. Kootwal took another photo, which he would later publish online. The man, a United Arab Emirates official, was named Saif, an acquaintance of Mohib’s who was well connected with Afghan power brokers. The meeting had not been listed on the president’s schedule that day.

It was nearly 11 a.m. when I stepped out of my house, and the traffic jam in the city had grown even worse. The cars in the street were at a standstill. Jim and I had no idea what would happen next. We were too busy to dwell on it; the sight of an entire world dissolving produced a certain numbness. There was the relentless sound of helicopters, while around us life continued as it had to — the shops and markets were open.

I had planned to meet two former translators from the U.S. military, who were desperately hoping to be evacuated with the departing forces. They got stuck in traffic and finally ended up walking the last mile; when they arrived, we decided to sit in the yard of a nearby restaurant, and have an early lunch.

Over a pan of chicken karahi, the translators, Mahdi and Nadim, told me about the time they’d spent with the U.S. Special Forces. Each had extensive combat experience, and several Green Berets had written them recommendation letters, but they’d still been waiting for years to go to America under the Special Immigrant Visa program for local employees. There was a backlog of some 20,000 applications. According to a U.S. official, Ghani had resisted a mass airlift, arguing that it would spark panic, and charter flights didn’t start until the end of July. In recent months, as the Taliban advanced on Kabul, their wait had turned to agony. Mahdi had reached the final stage and submitted his passport; in July, he was called to the embassy, where it was handed back to him, stamped “Canceled without prejudice” — most likely a paperwork snafu, he was told, but it would eventually be resolved.

“We don’t have any more time,” Nadim said, his voice rising. The two translators were certain the Taliban would behead them if they caught them. “If you don’t hear from us, it means we’re dead — so tell our story.”

It was almost noon; my phone had been on silent the whole time. I looked up and saw my driver walking toward us, a look of shock on his face.

“People are saying the Taliban have entered Kabul,” he told us. “They’re inside the city.”

Around 11 a.m., officials at the palace heard gunfire. Panic seized the N.S.C. building as rumors spread that the Taliban were attacking the palace. From his window, Najib Motahari, Bek’s chief of staff, could see some of Mohib’s staff running across the lawn, fleeing toward the gate — Tommies, he thought contemptuously.

On social media, there was talk that the Taliban had arrived at the outskirts of the city. Were the Taliban breaking the agreement for a cease-fire? At the N.S.C. building, Bek met with Rahimi, the president’s envoy, and began making phone calls, trying to find out what was happening. They spoke with Baradar’s team in Qatar, who insisted that their forces had not entered the city.

The Taliban were as surprised as everyone else by their lightning success; they weren’t prepared to take control of the capital and feared a confrontation with the Americans at the airport. To confirm the cease-fire agreement they had made with Rahimi, the Taliban spokesman now posted a statement online: “Because Kabul is a big city with a large population, the mujahedeen of the Islamic Emirate do not intend to enter by force, and negotiations are underway with the other side for a peaceful transfer of power.”

To the American team in Doha, the statement was validation that the back channel was in contact with the Taliban’s military leadership, who could deliver a cease-fire on the ground. “To have them release a long statement like that about their fighters does not occur without Yaqoub and Siraj’s blessing,” the U.S. diplomat told me. According to several Taliban commanders I later spoke to, they had received orders not to enter the capital. And local residents said that the Taliban massed at the city’s gates were in fact holding back at that point.

Bek, reassured, posted a message on Twitter at noon: “Don’t panic! Kabul is safe!”

But while Khalilzad’s team might have been optimistic about the cease-fire holding, the U.S. Embassy in Kabul had decided to get the last of its staff out immediately and haul down the flag. Twenty minutes after Bek’s post, the embassy sent out an alert that prompted many of Kabul’s foreigners to make a sudden dash to the airport. A security adviser at the embassy posted a WhatsApp message to a group of expats, giving a deadline of 5:30 that evening for helicopter evacuations from the Green Zone: “Urgent Update — the US Embassy advises that all foreign missions move to HKIA immediately.”

Hearing the driver’s news, I quickly paid for our meal and said farewell to the two interpreters. I told my driver to go home to his family and set out on foot. People were wild with fear, having heard that the Taliban were in the city. Some shouted into phones; others dashed heedlessly through traffic. The sound of helicopters and jets was loud in the sky. A motorcade of Land Cruisers, sirens blaring, forced its way through the intersection.

It was noon when I got home, and I found my housemate, Jim, with his camera in hand, already wearing a traditional robe. I donned mine; we both spoke Dari and could usually pass for locals. He wanted to take a walk and see what was happening in our neighborhood; it wasn’t clear to us, from the rumors and official denials on Twitter, whether the Taliban had actually entered Kabul.

The last shopkeepers were locking their gates as we walked down Chicken Street. Workers were rushing out of their offices and heading home. Now and again, we could hear scattered gunshots. There was a police headquarters and ministry nearby; some guards were still in uniform, but others stood wearing robes, ready to run. Some checkpoints were deserted.

A police commander lived on our street, and when we got back, we found his guards milling outside his house, most of them in plainclothes already. I had a sudden sense of the fragility of the social contract that bound us; our shared reality was melting into air. I was as worried about being robbed or shot by them as I was about the Taliban.

“Our leaders sold us out,” one of the police officers said. “If the Taliban come here, what can we do?”

We looked up. An American gunship was circling over the city, firing off shimmering flares.

After the panic that morning at the palace, Bek went to see Ghani and explained that the Taliban in Doha had announced that they would not enter the city. The president agreed to record a message to reassure the population of Kabul. It was filmed around 1:30, with Ghani sitting at a desk in his office that once belonged to King Amanullah, who fled the country a century earlier in the face of an Islamist uprising. Afterward, Bek and Rahimi went for lunch together. The presidential guards had locked down the palace and sent most of the staff away; the place was quiet. To Bek, the situation seemed under control.

But Mohib was getting ready to escape. He had never trusted the Taliban and believed that they had already started to enter the city. Mohib later wrote to me that Khalil Haqqani called him and asked him to surrender. “I explored their desire for negotiations, but it was clear they were set on a military victory,” he wrote. “They had not negotiated in good faith thus far, and they certainly were not in a position to have to do that on August 15.” Haqqani’s former aide disputed this, saying that Mohib asked to set up a meeting between their representatives and that Haqqani agreed and promised he wouldn’t be harmed.

Motahari, Bek’s aide, told me he saw Mohib’s senior staff running around the N.S.C. offices carrying bags and overhead them talking about the council’s operational cash. (Mohib and his staff denied taking bags of money out of the country.)

The president’s personal helicopters, on standby at the airport, were summoned to the palace. Three Mi-17s landed. Unusually, they were fully fueled, which meant they couldn’t carry as many passengers. According to several people present, a group that included Mohib and Rula Ghani boarded first; then Mohib went back with the head of the palace guard and returned with the president. Several of the president’s supporters later told me that Ghani had been reluctant to leave and had to be persuaded that his life was in danger.

As the president boarded, there was a fight between the remaining guards and staff over who would fit on board the last helicopter; Mohib’s secretary was thrown to the tarmac.

The helicopters took off and headed north. They were not returning to the airport, where, according to one official present, the U.A.E. was going to send a plane to evacuate them. Instead — whether it was because they feared the growing chaos at the airport or didn’t want to face the Americans — the president and his crew flew low through the mountains, trying to avoid detection by the U.S. military, which still controlled Afghanistan’s airspace.

By then it was around a quarter to 3. Bek was walking through the palace; he told me he didn’t realize the president had flown away in a helicopter. The sky was full of them that day. It wasn’t until he ran into an agitated Hanif Atmar, the foreign minister, who been holding onto the president’s passport, that Bek learned what had happened, he said.

“Do you know where the president is?” asked Atmar, who had arrived just as the choppers were taking off.

“The president went home,” Bek answered.

“No. He ran away.”

“I don’t believe it. I just saw him.”

“Look,” Atmar said, pulling out the passport with the seal of the republic on the cover. “He’s gone.”

When Jim and I got back from our walk, shortly before 2 p.m., I saw I had a message from Rangina: “Hi. Are you OK? What’s going on?”

I called her and we spoke briefly; she was at home, having left the education ministry around noon, accompanied by her staff. She didn’t know any more than I did about what was going on at the palace with Ghani. “I have no way of connecting with him, so I have no idea where he is,” Rangina said over the phone, sounding surprisingly calm. The Taliban’s announcement that they wouldn’t enter the capital by force had eased her mind; she had also heard a rumor that the Americans would take over security.

We said farewell. Jim and I decided to get on our bicycles and go for a ride around the city. As we came outside, we saw the police on our street fleeing in civilian vehicles, as the neighbors gaped.

The streets were almost empty of cars now, the shops shuttered. As we arrived at the traffic circle outside the U.S. Embassy, two Chinooks took off and roared overhead. We stopped and stared at the departing helicopters. “Remember, this is not Saigon,” the secretary of state would say on television later that day.

Jim got off his bike and started snapping photos. It was hot and my mouth was dry, so I bought some water from a juice cart. We could see plumes of smoke rising from inside the Green Zone. A convoy of armored S.U.V.s screeched through the roundabout, headed for the airport. Groups of ragged-looking men walked past, some carrying small bundles tied in scarves. “They’re prisoners,” the juice seller told us. “A big group of them came by earlier.” Earlier that day, the guards at the main prison in the city had fled, and the prisoners had broken loose — the same thing happened at the detention center in Bagram, north of the capital.

The Taliban were still nowhere to be seen downtown. We headed home, passing the palace gates, where there were still some guards outside. Jim and I had looped the whole Green Zone: the ugly concrete maws of its compounds stood open, the barriers upraised. Across the city, soldiers and police officers took off their uniforms, laid down their weapons and walked off into the evening light.

At Karzai’s house, a group of his advisers listened in dismay as the palace guards arrived and announced that Ghani and his entourage had fled. Karzai had planned to help negotiate the transfer of power; now the guards asked him to take charge of the palace. Abdul Karim Khurram, his former minister of information, was present and told me that Karzai declined, saying he had no legal basis to do so. They tried calling senior officials, including the minister of defense, but those they spoke to were in hiding or had already escaped to the airport. But Karzai chose to stay. He recorded a video, which they posted on Facebook that afternoon. In it, he stands with his three young daughters in front of him; the girls seem blissfully unaware, giggling as the littlest one tries to squirm away. “Citizens of Kabul, my family and I are here with you,” Karzai said, straining to raise his voice over the roar of jets and helicopters. “I call on the security forces and the Taliban to ensure the security of the lives and property of the people.”

Khurram said they were worried about what would happen once word of Ghani’s escape became public. Already, the situation in the city was deteriorating rapidly. According to a police officer who was monitoring the radio network that day, by lunchtime many of Kabul’s police stations had been abandoned, becoming targets of large, organized groups of looters. Around 4 p.m., the home of the deputy interior minister was visited by a convoy of armed men driving Rangers and Humvees they had taken from a nearby station. They were flying the Taliban flag, but the police officer who was present told me he recognized them — they were from a criminal gang from nearby Shakardara District. When he asked for a receipt for the vehicles and weapons they were seizing, they put a gun to his head.

That afternoon, as the situation grew increasingly chaotic in Kabul, Khalilzad convened a meeting in Doha with the Taliban leadership and Gen. Frank McKenzie, head of Central Command, who had flown in to explain the American plan for evacuation to his former enemies. They met in Khalilzad’s suite at the top of the Ritz Carlton; the two sides faced off across a table — on one, the craggy Marine four-star general, an Alabama native; on the other, Mullah Baradar, dressed in a long robe.

According to two people who were present, McKenzie gave a presentation about his mission to evacuate U.S. citizens and their allies. He spread two maps out on the table. One showed a narrow corridor between the U.S. Embassy and the airport, where his forces would be active. The second had a 30-kilometer radius drawn around the center of Kabul; any move by the Taliban into that zone, McKenzie warned them, would be interpreted as a hostile act. Baradar and the other Taliban leaned over the map, trying to find the names of the areas inside the 30-kilometer circle, which extended well past the gates of Kabul.

We already have some people inside there, Baradar answered.

McKenzie told him to withdraw their forces.

Baradar replied that the Taliban had no intention of interfering with the American evacuation. But the situation on the ground had changed. They all knew by now that Ghani had fled and that the republic’s forces were collapsing. Khalilzad and the Taliban had been getting messages from Afghan politicians in Kabul, begging for someone to take charge of security before the looting and violence got worse. Everyone feared what might happen come nightfall.

Who is going to take responsibility for Kabul — are you? Baradar asked.

Khalilzad and McKenzie looked at each other. My mission is what I described, the general said.

Baradar persisted, saying he wanted to know who would ensure security for the people of Kabul. He pointed a finger at McKenzie: Are you, general?

It was hard to know if the Taliban were serious in asking the United States to take over security in Kabul; according to the Biden administration, it would have required a massive troop deployment and was never considered as an option.

McKenzie repeated that he had his mission, and that was it.

In that case, Baradar asked, what if the Taliban went in and took over security?

There was a pause as the two sides conferred among themselves. Finally, McKenzie indicated the second map, with its narrow corridor. As long as there was no interference with his mission, the general said, he had “no opinion” on that.

It was nearly 5 p.m. when Jim and I returned home on our bicycles. Our driver, Akbar, was waiting for us; the streets were clear, so we decided to drive to the western outskirts of the city, where the main Taliban advance would be arriving from Wardak Province.

Traffic was light until we hit the main arterial road that runs west, where a stream of cars was leaving the city. As Akbar crept up the on-ramp, we got down and walked to the start of the driveway of the Intercontinental Hotel. The cops here had changed into robes as well, but still had their weapons. We introduced ourselves as journalists.

“The war’s over!” one said. He laughed. “We’ve surrendered.”

“You surrendered?” I asked “To whom?”

They smiled and pointed to a bearded man sitting in their midst; he had a black scarf over his head and was wearing white high tops. He carried a Kalashnikov and a radio. A Talib, the first we’d seen that day. He returned our greetings gruffly. Jim asked to take a photo, and he assented. He was from Wardak, and spoke a little Dari.

“How long have you been a mujahed?” I said.

“Eighteen years,” he said.

I asked if he had anything to tell the public.

“Don’t worry. We have no problem with ordinary people. All that’s propaganda.”

“What about the foreigners at the airport?”

“The foreigners should go. We don’t have any need for them,” he said. He’d assumed I was Afghan. “If you and I can make peace, then what do we need them for?”

The police had the giddiness of condemned men granted a reprieve; they crowded shyly around the Talib, who seemed annoyed by his duty but not in the least concerned about being surrounded by armed men who would have shot him a day ago. The cops wanted to pose for a photo with him. After Jim snapped it, the Talib waved us away. “Our leaders said we’re not supposed to give interviews.”

By now the car had made it up the on-ramp, and we got back in and headed to the western edge of the city, a predominantly Pashtun neighborhood called Company. The area drew rural migrants, many of whom were sympathetic to the insurgents. As we approached, we could see crowds gathered by the side of the road, cheering. A youth with a scarf wrapped around his face stood in the intersection, waving a white banner with handwritten Arabic script: THERE IS NO GOD BUT GOD AND MUHAMMAD IS HIS PROPHET.

A tan Ford Ranger drove by, with armed Taliban fighters sitting inside. Several more police and army vehicles followed, including Humvees and four-and-half-ton trucks; the Taliban on board were holding American rifles, M-16s and M-4s. They were carrying booty out of the city, back to their lines on the outskirts. The crowd of men, mostly young, was whistling and cheering; packs of little children ran after the trucks, trying to jump aboard the rear bumper. Jim had his camera out; the Taliban were happy to be photographed.

More fighters roared by on motorcycles, armed and blaring autotuned taranas, Islamic chants, from their cellphones. At the main Company roundabout, there was an immense crowd cheering: “Long live the Taliban.”

After flying for more than an hour, the three presidential helicopters arrived at the Uzbekistan border and landed; confusion ensued at the Termez airport as they were surrounded by soldiers — the Uzbek government had apparently not been informed of their arrival. Eventually, the president, his wife, Mohib and several aides were taken to the governor’s guesthouse, but the rest of the 50 or so people on board spent a miserable night out in the open by the helicopters, relieving themselves on the tarmac. The next day, a charter flight arrived and took them all to Abu Dhabi.

The U.A.E., which had deep business ties with Kabul’s elite, was a close ally of Ghani’s; according to three sources within the administration, Abu Dhabi had secretly helped fund his election campaigns. (The U.A.E. did not respond to a request for comment.) What exactly was discussed at that meeting between the U.A.E. official, Ghani and Mohib that morning remains a matter of speculation. Mohib told me that “we discussed an evacuation plan for the future, but not for that day.”

For many Afghans, their president’s flight from the country was a stunning act of cowardice and betrayal that plunged the capital into chaos. Days later, Ghani, in a statement posted to Twitter, promised to explain his actions in detail in the future and said he had left to avoid provoking a civil war. “Leaving Kabul was the most difficult decision of my life,” he wrote, “but I believed it was the only way to keep the guns silent and save Kabul and her 6 million citizens.”

Mohib made a similar argument to me, writing that the Afghan security forces were “no longer a consolidated force within our control at that point. Keeping security of the city without mobilizing militias and aerial bombardment was not possible, and we were not prepared to do that.”

In retrospect, it’s clear that the breakdown of Kabul’s command and control, along with mass desertions by government forces, was already underway by the time Ghani fled. But it also seems obvious that the president was not in immediate danger. His guard force was intact, and the Taliban were still nowhere near the palace that afternoon.

“It was the safest place in Afghanistan,” said Bek, his chief of staff.

Around 6:30, the news of Ghani’s escape finally broke. Around the same time, the Taliban published a second statement: “The Islamic Emirate has ordered its forces to enter the areas of Kabul that have been abandoned by the enemy, in order prevent thieves and looters from harming the people. … Mujahedeen are not allowed to enter anyone’s home, or harass anyone.”

The sudden fall of the city had caught the Taliban leadership without adequate forces on hand. Their men had been busy with capturing the neighboring provinces that same day; coordination was difficult, as many commanders avoided the use of phones and radio during daylight hours, for fear of airstrikes by the Afghan air force. The first Taliban units were scrambled into Kabul in the late afternoon, and headed for key locations like the army and intelligence headquarters, where they were aided by sleeper cells and sympathizers that emerged from hiding. But it took until sunset to collect a force of several hundred men in Wardak, who did not make it into town until well after dark.

In all, according to one senior Taliban commander’s estimate, the rebels took command of Kabul with well under a thousand men — less than the number of Marines at the airport, let alone the tens of thousands of Afghan security forces who had deserted their posts.

That night, the street in front of the palace gate was dark and empty as a Taliban convoy arrived, followed by an Al Jazeera Arabic crew they had summoned to witness their entry. Hamdullah Mokhles, the commander in charge, was a deputy to a senior leader from Helmand — in the end, it was the southern forces, and not the Haqqanis, who had the honor of entering the palace. Accompanying him was Salahuddin Ayubi, the military chief for the central zone, who had captured Wardak that morning, and a former Guantánamo detainee, Gholam Ruhani.

They waited for one of the palace guards to arrive, a general named Mohammadullah Andar. He unlocked the gate for them shortly after 10 p.m.; as they walked inside, Andar nervously told the journalists that he had been at the airport, hoping to escape, when one of Ghani’s officials in Doha, Masoom Stanekzai, had called him and told him to hand over the palace to the Taliban, promising him he’d be safe.

They arrived at a locked gate, to which Andar didn’t have a key. Hameedullah Shah, the Al Jazeera team’s producer, told me he suggested they go a different route, through Ariana Square, past the evacuated embassy and C.I.A. station. Ruhani replied that was a “red zone,” using the English term, and that the Americans might bomb them if they did. Instead, Mokhles, the leader, pulled out a pistol and shot open the lock.

Andar led the group deeper into the palace, into Ghani’s office. There they found the desk where, that same afternoon, the Afghan president had recorded his message to reassure the people. On it was a book of poems from an Afghan singer. As the cameras rolled, Mokhles and Ayubi sat down at the desk while a fighter recited a Victory Surah from the Quran:

Indeed, we have granted you a clear triumph, O Prophet.

In the days after the fall of Kabul, it sometimes felt as if we were living in two cities. In one, the streets were quiet, and people stayed home, afraid of the Taliban fighters with their turbans and long hair standing guard outside military compounds and shuttered embassies. In the other, the one the world was watching on TV, desperate crowds surged against the walls surrounding the airport as gunshots rang out.

I was receiving a constant stream of messages from Afghans asking for help escaping the country. Some were old friends; others, people I’d met once and interviewed. As a Westerner working in the developing world, I was used to my powerlessness in such matters. Usually, the most I could do was help people fill out the complex paperwork needed for programs like the Special Immigrant Visa. For years now, the West had been stepping up measures to keep Afghan asylum seekers out, making it almost impossible for them to get tourist visas, canceling study programs, paying countries like Turkey to build walls and even, in the case of Australia, detaining them on remote Pacific islands. Just 10 days earlier, six E.U. countries, including Germany, had warned against halting deportations of Afghans, saying that it sent “the wrong signal.” The evacuation — a collection of national efforts under the American military umbrella — was initially meant for countries’ own citizens, green-card and visa holders, and a limited group of locals, mostly current and former employees.

That changed the night of Aug. 15, when thousands of desperate Afghans overran the civilian terminal and spilled out onto the tarmac. On Monday morning, a U.S. Air Force C-17 was filmed taking off through the crowd. Several people were crushed under the wheels, while others, clinging to the underside of the jet, fell to their deaths as it lifted off. As these images played to a global audience riveted by the drama at the airport, the West, in a paroxysm of regret, opened its arms to Afghan refugees. Already, Canada had announced that it would take 20,000 people, a figure it would later double. Other countries followed suit, and the United States set up giant transit camps in Doha and other military bases overseas, to process Afghan evacuees for resettlement.

Although the West wanted to save Afghans from the Taliban, the evacuation could take place only with their tacit support. Their harried young fighters had taken over the southern, civilian side of the airport perimeter, where they used warning shots and whips to prevent the mob from overrunning the airfield, as they had on the first day. On the northern, military side, the line was held by Marines and the Zero Units.

With each day, even as people were shot and trampled at the gates, the crowds grew larger and more frenzied, some arriving from distant provinces. A few petitioners already had resettlement cases, like the interpreters I’d met the day of the fall, but many more came bearing some piece of paper they hoped would qualify them for evacuation — a certificate given to them years ago by the Marines in Helmand, a photograph from a conference for female activists or a U.N. observer’s card from a past, disputed election. There was a widespread belief that if you could only get inside the airport, you’d make it to Germany or Canada, and in fact, many had gotten out in the chaos of the first night, when, in order to clear the runway, people were bundled onto planes indiscriminately and flown to Doha.

For years, Afghans had been paying smugglers to cross deserts and mountains, risking their lives to reach Europe’s hostile frontiers. The desperate scenes around the airport — families, half-dead from dehydration, being tear-gassed and beaten by men with guns — reminded me of what I witnessed when I traveled the smuggler’s road five years earlier, during Europe’s border crisis. Now the border was here in Kabul, manned by the Zero Units and the Taliban.

For many Westerners who had been involved with Afghanistan over the past 20 years and were watching this disaster from abroad, the only way to do something was to help the Afghans they knew to escape. They tried lobbying their home governments, but some turned to direct action. A group of my friends connected to Sayara, a research-and-communications company that contracted with the U.S. government, had gotten together to try to evacuate Sayara’s local staff and others at risk. The list grew as they found donors who were willing to help get more people out — journalists, women’s rights activists and even members of the girls’ robotics team, whose faces had been painted on the wall outside the U.S. Embassy.

Soon they had raised more than a million dollars from places like the Rockefeller Foundation, enough to fly their own charter plane in. They got permission from the Ugandan government to bring people there while they waited for resettlement. Then they tried to get access to the airport; they started with the State Department and the military, but in the end it was another friend of theirs, a writer and former C.I.A. officer, who succeeded. He worked his contacts at the agency, whose paramilitary branch was playing a key role in the evacuation.

They needed someone on the ground in Kabul to get a convoy to the airport. They’d been in touch with me, asking for information; I’d been getting around through the crowds on my motorcycle and had a sense of what was going on there. Now one of my friends called and asked if I’d be willing to lead the buses in.

They explained who would be on the convoy: some local journalists I knew, some women from shelters that might be shut down by the Taliban. There would be four minibuses with more than a hundred people on board, many of them young children or elderly men and women. I knew that I was in a unique position to help them and that, in their desperation, they would go whether or not I did. So I said yes.

Two old friends had also volunteered, Andrew Quilty and Victor Blue, photojournalists who’d stayed behind in Kabul. The plan was to assemble the evacuees at the Serena Hotel downtown, and then drive to the airport. There was no way we could get through the crowds and traffic during the day, but if we left late enough at night, the roads might be clearer.

I’d ridden around the airport that afternoon to get a sense of the layout. On the north side, there was a road that ran along a wide sewage canal. Across the water, Hesco barriers and concrete walls were topped with guard towers, and on one I saw something I hadn’t seen in days: the tricolor of the republic, fluttering in the breeze.

While the army and police had surrendered and deserted en masse around the country, the Zero Units had remained mostly intact. There was already a large force at Eagle Base, the C.I.A.’s paramilitary compound in northern Kabul, which the Taliban had agreed not to attack during the evacuation; the agency had helped rescue some of the units; others made their own way to the airport. One was the Orgun Strike Force from the southeastern border, which had participated in some of the United States’ most secret missions, including covert operations inside Pakistan’s tribal areas across the border. They were led by a longhaired, mustachioed commander whose operations that summer I’d been following on an Afghan government Facebook page. (A U.S. official requested that he not be identified by name, to protect his family.) The Orgun commander and his unit were given the ugly job of crowd control on the perimeter.

Coming around the north side of the airport, still a long way from the main military gate, I hit a traffic jam, and as I threaded the bike through I saw the reason. The Zero troopers, in their desert tiger camo, had taken over the road. They stood in front of a narrow passage formed by concrete blast walls. This new entrance, which some dubbed Glory Gate, was supposed to be a low-profile one for U.S. citizens and other priority cases, but large crowds were gathering there. When people pushed too close, the troopers fired shots in the air or brandished steel cables. A few days before, the crowd had gotten inside, and videos on social media showed the Zero troopers forcing them back, firing live ammunition overhead, women and kids screaming, a man bleeding in the dust.

Around 7 that evening, Vic and Quilty came to pick me up in a taxi. On our way to the Serena, we discussed the latest news: There’d been a report that ISIS was planning to attack the airport. The threat was real, but who knew how imminent it actually was? In any case, it wasn’t going away. We arrived at the luxury hotel, which had been targeted several times by the Taliban. In one attack in 2014, my friend Sardar Ahmad, an Afghan journalist, was killed along with his wife and two of his children. It was unsettling when the door opened to reveal several bearded men with Kalashnikovs: the hotel’s new Taliban security. We were led in with a group of evacuees, where a Talib searched my bag, before letting me through to the scanner.

“Pretty funny, huh?” I muttered to Vic as we walked through the hotel’s driveway, passing more fighters.

“This is insane,” Vic replied.

In fact, the Serena was now one of the safest places in town, thanks to the Qatari Embassy, which had moved in earlier that year. The Qataris’ strategy of hosting the Taliban’s political office had paid off; they’d become a key intermediary between the West and the Islamists, and were now running their own evacuation convoys through the Taliban-controlled civilian gate.

As we entered the lobby, we could see Qatari special forces in black polo shirts with pistols. They had a convoy going tonight, and among the evacuees, I spotted Bilal Sarwary, a former BBC reporter, standing by the reception desk. We embraced.

“How are you doing?” I asked.

“Not very good and not very bad — in between,” he said, and laughed. “The time to process will come.”

Sayara had rented a hall in the back where, over the next few hours, our own evacuees assembled, around 140 people. I was surprised at how many kids there were. I stood at the front and introduced myself and Vic and Quilty, explaining we were going to get them safely to the airport. Looking at the rows of anxious faces, I tried to smile back with a confidence I didn’t feel.

Although I hadn’t put anyone on the list myself, it turned out that I knew a few of the people in our convoy. One of them was Ramin, the poet who’d recited at the party two months ago, sitting with a young woman with pale skin and high cheekbones.

“This is my wife,” he said, standing up to greet me.

When I met Ramin earlier that summer, they had already been engaged; when Kabul fell, the two got married so that they could escape together, in a tiny home ceremony where they played music on a mobile phone, with the volume turned down in case a Taliban patrol passed by.

“Are you planning to leave, too?” Ramin asked.

I explained that I was coming back with the buses, along with Quilty and Vic.

“Our friends have suffered a lot,” Ramin said. “Please be careful.” The previous day, he and his wife went to one of the gates controlled by the Zero Units, where the crowd had been tear-gassed and they were nearly trampled. He went home, hopeless, and tried to fall asleep; when he got up, he learned that a friend from France had put him on the list for this convoy.

I was wondering about him the day before and, on a whim, I’d left him a voice message and recited one of his poems. “Yesterday, when you sent me the message, I was in the crowd,” he said. “You read it very well.”

“Thank you. It’s a beautiful poem,” Before the fall, I had hoped to translate his work, but I’d only managed to commit one to memory, a love poem:

I’ll stay with you like a scent on the body,
I’ll stay with you like a half-forgotten song.

At 2 a.m., the scout car that we sent ahead reported back: There was still a traffic jam outside the main military entrance, but the road was clear in front of Glory Gate. Sayara was in touch with a C.I.A. contact at the airport, and soon after, I got a call from someone who introduced himself as one of the Orgun commander’s men, telling us to come.

It was shortly after 3 a.m. when we rolled out of Serena’s gates. I chugged my third energy drink of the night and lit a cigarette. The city center was deserted. I was in the lead bus, and our driver decided to take a shortcut behind the old attorney general’s office, where there was a height barrier intended to keep out trucks. As we passed under it, there was a crunch, and he slammed on the brakes. When he tried reversing, the metal roof began to shriek in protest. He’d wedged us under the barrier.

Twenty yards ahead, I saw a green laser sweep the road and fix on our bus. Three turbaned figures, carrying rifles, stepped out from the shadows and headed toward us.

“It’s the Taliban,” someone behind me whispered.

The other buses drove around us, where the barrier was higher, and sped off. Our driver was reversing back and forth, trying to get us unstuck, but the lead Talib broke into a jog and raised his hand for us to stop.

Salaam alaikum,” I called out the window, trying to smile.

“Where are you going?” he asked.

“The airport,” I said.

He stared inside at the bus crammed full of families with their luggage. “Mawlawi sahib!” He called to his commander. “They’re going to the airport.” The other waved us away.

“Be careful you don’t get shot,” the Talib said.

We got out from under the barrier, made a U-turn and took another street, where we linked up with the other three buses, and sped onward to the airport road. No more checkpoints. Soon we saw the neon lights of the gas station across from Glory Gate. I was worried about the trigger-happy troopers, and the mob outside. I texted the group to remind them to lock the windows.

“We’re close, slow down.”

The road was clear, but there were still hundreds of people hanging around the dirt lots along the road. Clouds of dust whirled up as we approached; the floodlights from the gate cast the shadows of concertina wire through the murk. A Zero trooper came forward and leveled his rifle at my bus.

“Get out of here!” he screamed. “Go!”

“We’re the Sayara convoy!” I shouted back. Leaning out the window, I recited the names we’d been given by the C.I.A.

Hearing them, the trooper dropped his barrel, and motioned for us to wait. After a few minutes, another came forward and took my passport. They had us pull forward, out of the road. Then I saw a bearded figure come from the gate, his muscular calves apparent under his shorts — an unusual sight since Afghans don’t wear shorts in public. He shone a flashlight on me, then on my passport.

“Hey, how are you?” he said in English. He asked about where we’d come from and who the passengers were.

“It’s all civilians,” I said.

“Well, you came to the right gate,” he said, and grinned.

He was an American operator, most likely with the C.I.A.’s paramilitary branch. He explained that we’d unload the buses, one at a time, so that the passengers could go through on foot to be searched. Then we’d load up again on the other side, and head into the airport.

I stood to the side and watched as the passengers, many still terrified, filed off and went inside. With the floodlights behind me now, the Zero troopers seemed forlorn in the dust, the remnants of a once mighty army, now carrying out a final, grim duty. Occasionally, there was a crack of gunfire: more warning shots against the crowd. Seated in a plastic chair by the gate was a large man with a drooping mustache. He was looking down at his phone, listening to a voice message.

He looked familiar. I asked if he was the Orgun commander.

He turned his exhausted gaze up to me. “Yes,” he said.

“I recognized you from your Facebook photos,” I said. So this was the man who’d been the scourge of the borderlands.

He smiled sadly. “Thank you.”

It took half an hour to get all four buses through the gate. As the last passengers were being checked, I walked over to where Vic was waiting. It was almost 4:30, and the dawn prayer was being called. A chorus of barking dogs rose from the wastes around us.

The second operator led us in his truck as we drove through the concrete passageways, past a blasted-out armored vehicle, through an inner gate manned by U.S. Army soldiers, until we finally reached the edge of the tarmac. A vast panorama opened before us: the lights of distant planes, like ships on the open sea, and in the foreground, the hulking airframes of C-17s and C-130s, their ramps down, lines of refugees walking onboard. Far to the south, we could see the civilian terminal. The sound of jet engines was deafening.

Our buses followed the C.I.A. truck to the military terminal, where there were U.S. Marines everywhere; some standing guard on the flight line, others crashed along a fence, sleeping against their rucksacks. There were soldiers from other NATO countries as well, sent to evacuate their nationals and local staff. Afghans sat together in groups, wherever they could find an open space to rest amid drifts of trash, empty water bottles and rations.

Now we had to get our evacuees to their plane, so that we could go home; I’d been told Sayara’s charter flight was already on the tarmac. The buses pulled to a halt next to a disabled Afghan Air Force C-130, a few hundred yards from the terminal. The operator, a burly man in a baseball T-shirt, got down from his truck and came over to me.

“I would not take these people out of the bus,” he said. He looked at the military planes around us. “Civilian charter. … I don’t see a civilian charter.”

As we walked toward the terminal, he explained that Marines were kicking some people off who didn’t have proper documents; we didn’t want to get the Sayara group mixed up with the others. “There’s around 20,000 people on this base right now, waiting for flights,” he said.

At the terminal, the Marine in charge, a harried lieutenant colonel, was polite, but said he didn’t know where to put our group, either. We were the C.I.A.’s responsibility; the operator suggested that he and I drive over their compound to figure things out, so I got into his armored pickup.

Dawn was breaking on the tarmac. He blinked with fatigue as he explained that he arrived a couple of days before, part of a team rushed to help out with the evacuation. “Everybody thought that it was going to last longer,” he said. “We knew it was gonna fall, but we thought months.”

“Have you been here before?” I asked.

“Double-digit times, man. You lose count.”

He said the C.I.A. had been pulling people out all over the country: American citizens and important assets, often through touch-and-go missions into Taliban-held territory.

A C.I.A. spokeswoman later told me, “The C.I.A. worked closely with other U.S. government agencies to support in various ways the evacuation of thousands of American citizens, local embassy staff and vulnerable Afghans.”

We arrived at an area with several hangars that the C.I.A. had taken over. Two C-17s were loading at its ramp, with a long line of men, women and children behind each, carrying bags and bundles. The Zero Units were allowed to bring their immediate family members, and the operator said that given the large size of Afghan families, it would add up to thousands. Each C-17 could carry 400 people, and one had to get out every two hours. They were already behind.

The Sayara team had finally sent me the tail number for their charter plane, so we decided to go over to the civilian side of the airport and see if we could find it.

We drove around the west end of the runway. The operator stopped and looked both ways for jets before we crossed. “I don’t know who’s in some of these buildings,” he said. The airport was a mess. The Taliban were supposed to stay on the outside of the civilian terminal, but the perimeter was worryingly porous.

“There’s a Kam Air flight there,” he said.

A jet with orange livery was parked on the tarmac. We got closer and read the tail number; it was the right plane, but it did not look as if it would be flying any time soon.

My phone buzzed again, and I read a message from my friend at Sayara aloud: “Hey I just talked to the plane people, and this charter is far from secured. It might be days.”

We circled around in the truck.

“Huh,” he finally said. We headed back to the C.I.A. ramp, where the C-17s were still loading. Inside the hangars, I could see masses of bedding and garbage. “It’s a humanitarian disaster,” he sighed. He seemed bitter about the way the Zero Units had given up the fight, like the rest of the Afghan forces.

He was coming off his shift, so he handed me off to a colleague, another bearded operator, who dropped me off in a hangar to wait on instructions from above about what to do with Sayara evacuees. Three young Marines sat at a folding table in front of laptops, registering Zero troopers and their families.

I poured myself some coffee and sat down, watching the scene. The contrast with the military’s side of the airport, where there were Marines everywhere, was revealing; here, around a dozen C.I.A. paramilitary officers were handling thousands of locals, many of them armed but obedient. Their faithfulness was being rewarded with passage to America. And as the only Afghan forces who controlled part of the perimeter, they had the ability to bring their own people inside. I wondered how these men, who had been fighting a vicious battle in the borderlands with Al Qaeda and ISIS, would adjust to life in the United States.

The operator returned with a clamshell full of pancakes and sausage, which I wolfed down gratefully. We discussed what to do with the Sayara convoy; the best solution seemed to be to leave them with the Marines, after all. We drove back over to the buses and pulled around to the entrance, where everyone got down with their bags. We still needed to find somewhere for them, for the long wait ahead; I spotted a Marine sergeant, and explained the situation, as we had to his colonel a few hours ago. He was a young guy with red hair and a raspy voice.

“Yeah, how about right there?” he said, pointing to a small outdoor waiting area next to the terminal. He grabbed a couple of his Marines, and within a few minutes they had kicked out some others hanging around to make room for all 140 of Sayara’s evacuees.

We said goodbye and wished them luck, and then Vic, Quilty and I got back on the buses and rode back into the city. The sun was bright, and the crowds were already starting to gather — the few with papers to get inside and the many without them.

As August reached its end and America’s self-imposed deadline for the evacuation neared, the violence at the airport grew more frenzied. Sayara asked us to lead another convoy two days later, this time with five buses. We made it to Glory Gate in the early hours of the morning, but this time Sayara’s connection to the C.I.A. failed. The operator on duty, one we had seen before, refused to let us through. Sitting outside in the buses, I watched a huge convoy arrive from nearby Eagle Base, which the C.I.A. was getting ready to blow up.

The Orgun commander was gone, one of the troopers outside said. He seemed high on something; his pupils were enormous. He giggled and fluttered his hand. “He flew away.”

Our friends at Sayara tried to work their contacts with the U.S. government, sending us to different gates as daylight broke and the crowds grew. One of our buses broke down; a mob tried to break inside; we made a last-ditch attempt at the Taliban-controlled gate, but when I got down to try talk with them, a fighter started punching me in the head. In the end, we were lucky to get everyone back to the Serena alive.

On Aug. 26, an ISIS suicide bomber made his way through the crowd to the Marines at Abbey Gate and detonated his vest, killing 13 American troops. Jim and I went down to the site and then to the emergency hospital, where they were bringing in bodies on stretchers. Almost 200 people were killed; it seemed like too many for a single bomber. Some might have been trampled or drowned in the sewage ditch; according to several witnesses I spoke to, the Marines, who must have feared another bomber, also fired on those who panicked and tried to climb the walls. A doctor at a government hospital said that many of the casualties he saw had bullet wounds. (A spokesman said there was no evidence the Marines shot anyone during the evacuation.)

Three days later, the United States carried out a drone strike inside the city, on what it said was another ISIS terrorist. The top U.S. general told the public it was a “righteous strike.” We went to the house the next morning, where, in a courtyard strewn with a charred sedan and bits of flesh, a family and their neighbors wept in rage and grief. The drone’s Hellfire had killed 10 innocent people, seven of them children, as the military would later admit. That was the last known missile fired in what they once called the good war.

Nightfall brought an intensification of air traffic; I’d lie in bed and listen to the planes, trying to distinguish the roar of C-17s and fighter jets, the buzz of Reaper drones, the hum of a C-130’s propellers as it climbed from the tarmac. The night of Aug. 30 was the busiest we’d heard it yet, and then, shortly before midnight, it tapered off. Jim and I walked out into the yard and marveled at the quiet. Then we heard scattered gunshots, followed by more, until it sounded as if we were at the center of a raging gun battle. Every Talib in the city was firing into the air, celebrating the departure of the last American soldier. From our window, we could see red tracer fire crisscrossing above the city, deadly fireworks.

The next morning, the Taliban held a news conference at the airport. Their soldiers at the gate let us through; Jim and I walked down the long avenue, brass cartridges scattered underfoot. Heaps of suitcases, their contents emptied into piles, littered the median. The terminal parking lot was a snarl of abandoned vehicles left behind, ordinary cars, U.N. four-by-fours and armored S.U.V.s, some flipped on their sides or parked nose to nose as barricades: One big GM, blocking the road sideways, had its plated window punched open by gunfire. The Taliban guards here were just waking up from last night’s party; they had a big dog with them, probably one of the many left behind during the evacuation; the terminal was full of shattered glass, its furniture overturned, pallets of water bottles and M.R.E.s scattered around. It was like a hurricane-ravaged, abandoned coast.

The ceremony was on the military side, so the Taliban gave us a ride in the bed of a truck that had belonged to a Zero Unit, the kid at the wheel speeding recklessly across the tarmac, taking us to where the officials were giving a victory speech in front of a listing, disabled C-130. Their special forces were lined up, wearing helmets and uniforms. Suddenly, we heard a bang, and I turned to see two Rangers colliding out on the runway, one rolling and flipping high into the air before it crashed down. The ceremony went on.

Afterward, Jim and I walked back out through the gate; and stood staring at the roundabout where traffic was flowing normally. Apart from a small group of onlookers, the crowds were gone. The spell was broken.

“There aren’t any foreigners inside?” a street kid asked. He had a can of incense on a wire.

“No,” I said. “They’re gone.”

After the fall of the capital, it took time to get used to seeing Taliban at the checkpoint outside our house. In the days that followed, their scarce numbers in Kabul were bolstered by fighters from the provinces, arriving with the long hair and beards that would have gotten them profiled for arrest in the capital not long ago. Young, off-duty Taliban wandered around, clutching their weapons and staring at the bright lights and gaudy storefronts, while the city dwellers looked back warily. Although the Taliban rank and file had been ordered not to harass residents, the men of Kabul swapped jeans for traditional garb, while the women wore concealing clothes, if they ventured out at all. Abandoned by their leaders and security forces, the capital’s residents waited for what would befall them under the Islamic Emirate.

On Aug. 17, just two days after they captured Kabul, the Taliban held their first news conference. Jim and I rode down to the government media center, located inside the former Green Zone, where we found a line of local reporters waiting outside, their tailored suits traded for robes. Inside, we sat in front of a dais flanked by marble staircases, waiting for Zabihullah Mujahed, the longtime Taliban spokesman, whose voice we knew but whose face we’d never seen. After a moment, Mujahed and his aides descended stage left. He took his seat in front of the microphones. A diminutive, well-spoken man, he wore a turban in a tribal pattern from eastern Afghanistan. He announced that the Taliban would keep their promise of an afwa, the general amnesty.

“We have pardoned all those who had fought against us,” he said. “The Islamic Emirate does not have any animosity with anyone. The fighting has come to an end, and we want to live in peace.”

For a movement confident in its victory, and in need of domestic and international support, the announcement made sense. And despite dire expectations, Kabul had fallen with remarkably little bloodshed. There were no massacres or roundups, and so far the few high-profile politicians who hadn’t evacuated, like Karzai, had been left in peace. “You thought the Taliban were going to devour and kill everyone, but that didn’t happen,” Ayubi, one of the commanders who’d taken over the palace, told me. Afghans were tired of war, he said, and the Emirate wanted to halt the cycle of killings and retribution that had raged for four decades.

But even if the leadership was sincere, could they control their fighters? I met a young commander named Mullah Sangin who, like many of the Taliban in the city, rushed here from a neighboring province after the fall. Sangin was from Wardak’s Tangi Valley, and he told me he was one of a few survivors from a group that had shot down a helicopter carrying Navy SEALs there in 2011. Tall and gaunt, wearing a black turban, Sangin was only in his late 20s but now led a group of a couple of dozen men within the intelligence commission. Restaurants and other businesses had started to reopen in the capital, and we ate lunch at the same spot where I’d gone with the interpreters the day the city fell. The staff was surprised to see me arrive with the Talib commander and his Kalashnikov-toting driver. Sangin and I sat across from each other, smiling at how surreal it was to be meeting like this. I was the first non-Muslim he’d ever shared a meal with, he told me; he was used to thinking of foreigners as invaders. “But you’re a guest in our country,” he said.

This summer, as the prospect of victory began to seem real, the leadership had emphasized the order to spare the life and property of those who surrendered. During the Eid al-Adha celebration in July, the amir, Haibatullah Akhunzada, had disseminated a message over WhatsApp explaining that a general amnesty would be granted once the Taliban were victorious, just as the Prophet Muhammad had done after capturing Mecca 14 centuries earlier. Sangin said it even included the Zero Units, his mortal enemies, who were still guarding the evacuation in progress at the airport.

“We were greatly wronged by them, but we will forgive them, because when the amir gives an order, we must obey,” he told me. He referred to the religious concept of eta’at; disobedience to one’s amir was a sin. But Haibatullah, a religious scholar from Kandahar, had yet to appear in public, and Sangin and his men, like the rest of the country, were waiting to see what kind of government the Taliban would institute. He was certain about one thing: It would be an emirate, not a republic. “Our constitution is the Quran and Islam,” he told me.

When I showed up at Rangina’s house, there were no guards outside anymore, and her government-issued armored S.U.V. was gone from the driveway. When the Taliban had taken it, they’d assured her she would be safe. But she was getting ready to evacuate; there was only a week remaining until Aug. 31, the deadline for the troops to leave, and she and Abdullah had decided to take Zara and get out.

The day before, Rangina had been invited to a meeting at the ministry with members of the Taliban’s education commission. Schools were closed since the collapse of the republic, but Rangina had wondered if they might ask her to continue in a temporary capacity, like Waheed Majrooh, the minister of public health, who’d remained and helped keep the hospitals running through the violence at the airport. Rangina arrived with her deputy to find several older men in turbans sitting in her office. They were formal but polite; one turned out to be from a village in Kandahar next to her father’s. Together, they went to speak to the ministry’s senior staff. After thanking God for their victory, one of the Taliban officials gave a speech about placing Islam at the center of a new curriculum — now their fundamentalist vision would shape the next generation of Afghan children.

Afterward, the officials served her melon in the office. She wanted to know whether girls would be denied higher education as they were in the 1990s. The Taliban assured her that they would be allowed to study past sixth grade, but only after a system was worked out to keep men and women separate, in accordance with religious law.

“I don’t know if their definition of Shariah has changed from 20 years ago or if it’s the same Shariah — that’s the big question,” Rangina told me. “Shariah is not a book that you can pick up and say, ‘Here’s Shariah.’ It’s history and laws and regulations over 1,400 years, and it’s open to interpretation.”

The officials told her she no longer had a job at the ministry, but they asked her to stay in Afghanistan. They suggested she could help them by speaking to the media and telling the world they weren’t the monsters they were made out to be. Rangina was offended. “They just want me as their female spokesperson,” she said.

As a former minister and U.S. citizen, Rangina had been prioritized for evacuation. As we talked, her phone rang, and she answered it. It was a Marine, calling from the military base in Qatar. “If we can help you out, would you be willing to work with us to get through a gate in HKIA and get put on an airplane?”

The next day, her deputy, Attaullah Wahidyar, drove them in a truck to Glory Gate, with Zara sitting quietly beside her and Abdullah in the back seat. Rangina was racked with guilt over leaving; maybe if she stayed, the Taliban would be willing to listen to her. Wahidyar was certain she was making the right decision. “They would have used her,” he told me later. “You can’t say no to a Talib with a gun.”

In the back of the pickup speeding toward the airport, Rangina wept as she remembered another journey she’d taken as a scared child more than 30 years ago. In the middle of the night, her father had taken the family and fled the Communists in a truck like this one, and they’d become refugees. But now the little girl in the back seat was her own daughter, and she was sitting in her father’s place. And Ghulam Haider was dead, murdered, a martyr for the lost republic and the country she was leaving behind.

A few days after the evacuation ended, I passed by the office of Etilaat-e Roz and was surprised to find Zaki still there. A couple of weeks earlier, he’d told me that he and his staff had decided to leave while they still had a chance to get out. But they hadn’t been able to get through the crowds at the airport. Zaki had been offered a place on our Sayara convoy, but he wasn’t willing to go without his colleagues

The Qataris, who were helping the Taliban get the airport running again, were still flying out some evacuees, so Zaki was hopeful that they could leave as a group in the coming days. A few of Zaki’s journalists were sitting around the office, looking depressed. They told me they hadn’t been out reporting yet; they were afraid of the Taliban on the street. I tried to reassure them by recounting how Mujahed, the spokesman, had given me a letter of permission, and that I’d been able to keep working, even interview Taliban officials.

Two days later, I got a message from Zaki saying that some of his staff had been arrested covering a protest by women’s rights activists outside a police station. I rushed over, but by the time I got to his office, they had already been released. Two were beaten so badly that they had to be taken to the hospital, including Zaki’s younger brother, Taqi. I went over and persuaded the nervous staff to let me in; the two reporters were just being wheeled out of the X-ray department.

“Hi, Matthieu,” Nemat Naqdi whispered from his gurney. I peered at the gauze swaddling his face and realized, with a stab of guilt, that he was one of the young journalists I’d exhorted to get out and work. He and Taqi, who hadn’t gotten permits from the Taliban, were arrested at the demonstration, taken into a room and whipped. Nemat was hit so hard that he lost partial vision in his right eye.

Taliban officials would later apologize for the incident, but no action was taken against the fighters who were now functioning as the police. According to the Taliban, public protests were illegal without a permit, and given the current emergency situation, permits would not be granted. Covering such protests was illegal, too. Although the Taliban claimed that free speech would be allowed “within the limits of Islam,” they had never made any pretense to liberalism. When I sat for an interview with Mujahed, he told me that democracy and Islam were incompatible; in the former, the people were sovereign, but according to the latter, God and the Quran ruled. In a world where even dictators paid lip service to democracy, the Taliban offered a remarkably frank vision for a religious theocracy.

And yet, like Mullah Baradar, the chief negotiator in Doha, Mujahed was seen as representing a relatively moderate tendency within the Taliban, one that advocated a pragmatic engagement with the world. There was still hope for the “inclusive” approach that had been promised under the agreement scuttled by Ghani’s escape, but the interim cabinet announced on Sept. 7 was drawn from the movement’s old guard — most were Pashtun, many were elderly clerics and all were men. The Taliban’s total military victory had strengthened its hard-liners. Baradar, who many in the West had expected to lead the new cabinet, was made a deputy.

Rangina’s replacement as acting minister of education had previously run a madrasa in Pakistan. When high schools were reopened in September, only boys were given permission to return; while in some provinces girls were also quietly allowed, as the end of the year approached, most in the country were still being kept out of school.

The heat of the summer passed. The nights grew longer. On crisp mornings, the smell of wood smoke filled the air in Kabul. The city’s residents and the Taliban fighters were adjusting to one another; some of the jeans reappeared, while the Taliban donned a patchwork of uniforms that had belonged to the republic. When I had visited the remnants of the C.I.A.’s Eagle Base, the fighters who accompanied our group of journalists on a tour wore operator-style helmets and carried American-made weapons; some even wore the tiger stripes of the Zero Units.

In the end, nearly everyone who could leave left. Zaki and his team made it out to the transit camps in Doha to await resettlement in the United States, as did Mahdi and Nadim, the translators I interviewed the day the city fell. Ghani was in Abu Dhabi writing a book, a follow-up to “Fixing Failed States,” perhaps. Rangina moved to Arizona with Abdullah and Zara, where she was offered a teaching job at a university. The Orgun commander and the Zero Unit troopers were sent to military bases in America, where they would begin new lives as refugees. Ramin and his wife were given an artist’s residency in a French farmhouse, where he was writing of his longing for his city, a Kabul that now lived on in the imagination of a new diaspora.

Although daily life had returned to the capital’s streets, after dark they quickly emptied out, apart from the fighters standing at intersections. I stayed inside, too — my friends were gone from this city where the music had fallen silent. I was longing to get out, and finally, more than two months after the fall of Kabul, I headed south, toward Kandahar. Akbar and I took turns at the wheel; the valleys of Wardak stretched out, barren mountains behind them. We rolled down the windows and breathed the clear air, careful to turn down the stereo at checkpoints. Highway 1, which had been a battleground for more than a decade, was safe enough now to drive at night, although you had to watch for the craters from roadside bombs, which the emirate was slowly trying to patch. The farther we traveled from Kabul, the less nostalgia people seemed to have for the republic. In Panjwai, outside Kandahar City, the farmers had dug up the I.E.D.s and were planting crops. Everywhere, white flags fluttered above the graves of young men.

“Not a day would go by without dozens of bodies coming back along this road,” Akbar said. He was from a valley north of Kabul that had provided many recruits for the Afghan Army. He had never been to the south before; now he sat with farmers in pomegranate orchards, comparing their experiences on opposite sides of the war. “We thought the people here have been cruel to kill so many of our sons like that. Now I see they suffered just as much. Maybe more.”

For ordinary people in the countryside, the fall of the republic had at least brought an end to the fighting. But the Taliban hounded former officials, searching their homes for weapons and government vehicles. In Kandahar, I was told about a quiet campaign of kidnappings and assassinations of former police and intelligence officers by Taliban fighters — which their leaders denied — some driven by local disputes, others by revenge.

Akbar and I drove westward to Helmand. Outside the cities, we saw few armed men. We passed the bases built with foreign money, many bearing the scars of final battles. Most were empty, with only a white flag fluttering above; some whose Hesco barriers had been raided of wire for scrap were now melting back into the earth. It felt as if the country, deprived of a constant input of dollars, was returning to a lower energy state. The economy was in free fall, the banks were out of cash; it had been a drought year, and everyone feared the hunger that winter would bring.

On the highway near Shurabak, we passed a series of concrete walls, which I recognized as the entry points for the enormous air base that had been run by the Marines. I thought about my visits there, when the runway was crowded with jets, and tried to remember the brash generals who’d explained, year after year, how they were winning — they just needed more troops, more money, more time. Twenty years had passed, long enough for a child to be raised, to finish her studies and become a young woman. That was the life span of the republic. Now the dream was over and America was gone, along with an elite that fled even before the last foreign soldier was out, leaving behind a country on the brink of starvation.

We kept driving to Nimruz and reached the Iranian border. Here the desert began. A great exodus was underway. We watched as the migrants crowded onto trucks, heading west.


Matthieu Aikins has worked in Afghanistan since 2008 and is currently a Puffin fellow at Type Media Center. His first book, “The Naked Don’t Fear the Water: An Underground Journey With Afghan Refugees,” will be published by Harper in February. Jim Huylebroek is a photographer from Belgium who has been living in Kabul since 2015 and working for The Times since 2017. His first photo book, “Afghanistan: Unsettled,” was published in cooperation with the Norwegian Refugee Council. Safiullah Padshah, Yaqoob Akbary and Wali Arian contributed reporting.