After two decades in Afghanistan, America's longest war was ending with the image of the United States in tatters.
With the swift collapse Sunday of the government in Kabul, the 20th anniversary of the September 11 attacks that triggered the US invasion will be marked with the Taliban back in control of Afghanistan, despite a cost to the United States of nearly 2,500 lives and more than $2 trillion.
To some observers, the debacle following the withdrawal of US troops will inevitably weaken the United States on the global stage at a time when President Joe Biden was speaking of rallying democracies in the face of a rising China.
"America's credibility as an ally is diminished because of the way the Afghan government was abandoned beginning with the Doha talks," said Husain Haqqani, Pakistan's former ambassador to the United States, referring to the deal last year in the Qatari capital with the Taliban in which the United States set a pullout timeline.
Haqqani, now a senior fellow at the Hudson Institute, noted how US diplomats in the end could do little more than send tweets urging the Taliban to stop.
"That envoys of the mightiest nation on earth can be duped as they were in Doha, and its leaders ignored so easily as they have been in the final days, will encourage others to engage in duplicitous diplomacy," Haqqani said.
Biden faced heated criticism that the withdrawal was mismanaged, with the United States racing to evacuate its sprawling embassy just a month after he played down fears the Afghan government would crumble quickly.
"It is going to have ramifications not just for Afghanistan," said Representative Liz Cheney, a Republican hawk.
"America's adversaries know they can threaten us, and our allies are questioning this morning whether they can count on us for anything," she said in an ABC interview.
Mixed message to China
The Biden administration is quick to point out that former president Donald Trump negotiated the Doha deal on the withdrawal and that a majority of the US public favors ending "forever wars."
Trump has repeatedly put the blame on his successor, however, calling for him to resign on Sunday "in disgrace for what he has allowed to happen to Afghanistan."
"What Joe Biden has done with Afghanistan is legendary. It will go down as one of the greatest defeats in American history!" he said in an earlier Sunday statement.
Secretary of State Antony Blinken, also speaking on ABC, said the United States had "succeeded" in its primary mission of bringing justice to the Al-Qaeda perpetrators of the September 11 attacks.
"It's also true that there's nothing that our strategic competitors around the world would like more than to see us bogged down in Afghanistan for another five, 10 or 20 years. That is not in the national interest," Blinken said.
China, which the Biden administration sees as the nation's pre-eminent challenge, has already rhetorically pounced, with the nationalistic state-run Global Times publishing an analysis saying Afghanistan showed Washington to be an "unreliable partner that always abandons its partners or allies to seek self-interest."
But Richard Fontaine, chief executive officer of the Center for a New American Security, said it was simplistic to think that China would be emboldened, for example, to move on Taiwan, a self-ruling democracy claimed by Beijing that depends on US weapons.
China may instead see the high cost that the United States is willing to pay in exiting Afghanistan as a sign of seriousness in shifting to the Pacific, Fontaine said.
But Fontaine, who opposed the withdrawal, said the United States was taking major risks by effectively ceding Afghanistan to the Taliban, who never formally broke with Al-Qaeda.
"Now that it looks like the Taliban will be running the country, I think the chances of a terrorist threat are pretty high," he said.
"If that's the case, it could well increase distraction from our focus on the bigger strategic challenges in China."
New era on military?
Some policymakers argued for maintaining a residual force of some 2,500 troops in Afghanistan, but Biden decided the war was over and he should not risk further US lives.
Trita Parsi, executive vice president of the Quincy Institute for Responsible Statecraft, which supports US military restraint, said the ones who have now lost credibility are advocates for a continued war.
"When you see that the whole thing falls apart in nine days, this was nothing more than a house of cards," Parsi said.
He hoped the withdrawal would help end the view, in Washington but also among allies, that the US military should be the first resort.
"Perhaps some of the external pressures on the United States to act as if it is the answer to everything in the world will reduce."