KABUL, AFGHANISTAN -- The Taliban swept into Afghanistan's capital Sunday after the government collapsed and the embattled president joined an exodus of his fellow citizens and foreigners, signalling the end of a costly two-decade U.S. campaign to remake the country.
Heavily armed Taliban fighters fanned out across the capital, and several entered Kabul's abandoned presidential palace. Suhail Shaheen, a Taliban spokesman and negotiator, told The Associated Press that the militants would hold talks in the coming days aimed at forming an "open, inclusive Islamic government."
Earlier, a Taliban official said the group would announce from the palace the restoration of the Islamic Emirate of Afghanistan, the formal name of the country under Taliban rule before the militants were ousted by U.S.-led forces in the wake of the 9/11 attacks, which were orchestrated by al-Qaida while it was being sheltered by the Taliban. But that plan appeared to be on hold.
Kabul was gripped by panic. Helicopters raced overhead throughout the day to evacuate personnel from the U.S. Embassy. Smoke rose near the compound as staff destroyed important documents, and the American flag was lowered. Several other Western missions also prepared to pull their people out.
Fearful that the Taliban could reimpose the kind of brutal rule that all but eliminated women's rights, Afghans rushed to leave the country, lining up at cash machines to withdraw their life savings. The desperately poor -- who had left homes in the countryside for the presumed safety of the capital -- remained in parks and open spaces throughout the city.
Though the Taliban had promised a peaceful transition, the U.S. Embassy suspended operations and warned Americans late in the day to shelter in place and not try to get to the airport.
Commercial flights were suspended after sporadic gunfire erupted at the Kabul airport, according to two senior U.S. military officials. Evacuations continued on military flights, but the halt to commercial traffic closed off one of the last routes available for fleeing Afghans.
Many people watched in disbelief as helicopters landed in the U.S. Embassy compound to take diplomats to a new outpost at the airport. U.S. Secretary of State Antony Blinken rejected comparisons to the U.S. pullout from Vietnam.
"This is manifestly not Saigon," he said on ABC's "This Week."
The American ambassador was among those evacuated, officials said. He was asking to return to the embassy, but it was not clear if he would be allowed to. The officials spoke on condition of anonymity to discuss ongoing operations.
As the insurgents closed in, President Ashraf Ghani flew out of the country.
"The former president of Afghanistan left Afghanistan, leaving the country in this difficult situation," said Abdullah Abdullah, the head of the Afghan National Reconciliation Council and a longtime rival of Ghani. "God should hold him accountable."
Ghani later posted on Facebook that he left to avert bloodshed in the capital, without saying where he had gone.
As night fell, Taliban fighters deployed across Kabul, taking over abandoned police posts and pledging to maintain law and order during the transition. Residents reported looting in parts of the city, including in the upscale diplomatic district, and messages circulating on social media advised people to stay inside and lock their gates.
In a stunning rout, the Taliban seized nearly all of Afghanistan in just over a week, despite the billions of dollars spent by the U.S. and NATO over nearly 20 years to build up Afghan security forces. Just days earlier, an American military assessment estimated that the capital would not come under insurgent pressure for a month.
The fall of Kabul marks the final chapter of America's longest war, which began after the Sept. 11, 2001, terror attacks. A U.S.-led invasion dislodged the Taliban and beat them back, but America lost focus on the conflict in the chaos of the Iraq war.
For years, the U.S. sought an exit from Afghanistan. Then-President Donald Trump signed a deal with the Taliban in February 2020 that limited direct military action against the insurgents. That allowed the fighters to gather strength and move quickly to seize key areas when President Joe Biden announced his plans to withdraw all American forces by the end of this month.
After the insurgents entered Kabul, Taliban negotiators discussed a transfer of power, said an Afghan official. The official, who spoke on condition of anonymity to discuss details of the closed-door negotiations, described them as "tense."
It remained unclear when that transfer would take place and who among the Taliban was negotiating. The negotiators on the government side included former President Hamid Karzai, leader of Hizb-e-Islami political and paramilitary group Gulbudin Hekmatyar, and Abdullah, who has been a vocal critic of Ghani.
Karzai himself appeared in a video posted online, his three young daughters around him, saying he remained in Kabul.
"We are trying to solve the issue of Afghanistan with the Taliban leadership peacefully," he said.
Afghanistan's acting defense minister, Bismillah Khan Mohammadi, did not hold back his criticism of the fleeing president.
"They tied our hands from behind and sold the country," he wrote on Twitter. "Curse Ghani and his gang."
The Taliban earlier insisted that their fighters would not enter people's homes or interfere with businesses and said they would offer "amnesty" to those who worked with the Afghan government or foreign forces.
But there have been reports of revenge killings and other brutal tactics in areas of the country the Taliban have seized in recent days. Reports of gunfire at the airport raised the specter of more violence. One female journalist, weeping, sent voice messages to colleagues after armed men entered her apartment building and banged on her door.
"What should I do? Should I call the police or Taliban?" Getee Azami cried. It wasn't clear what happened to her after that.
An Afghan university student described feeling betrayed as she watched the evacuation of the U.S. Embassy.
"You failed the younger generation of Afghanistan," said Aisha Khurram, 22, who is now unsure of whether she will be able to graduate in two months. She said her generation was "hoping to build the country with their own hands. They put blood, efforts and sweat into whatever we had right now."
Sunday began with the Taliban seizing Jalalabad, the last major city besides the capital not in their hands. Afghan officials said the militants also took the capitals of Maidan Wardak, Khost, Kapisa and Parwan provinces, as well as the country's last government-held border post.
Later, Afghan forces at Bagram Air Base, home to a prison housing 5,000 inmates, surrendered to the Taliban, according to Bagram district chief Darwaish Raufi. The prison at the former U.S. base held both Taliban and Islamic State group fighters.
Akhgar and Faiez reported from Istanbul and Gambrell from Dubai, United Arab Emirates. Associated Press writers Kathy Gannon in Guelph, Canada; Joseph Krauss in Jerusalem; Matthew Lee in Washington; James LaPorta in Boca Raton, Florida; Aya Batrawy in Dubai; and Frank Jordans in Berlin contributed to this report.