As President Joe Biden ends the US combat role in Afghanistan this month, Americans and Afghans are questioning whether it was worth the time, cost and casualties.
More than 3,000 American and other NATO lives lost, tens of thousands of Afghans dead, trillions of dollars of US debt that generations of Americans will pay for, and an Afghanistan that in a stunning week of fighting appears at imminent threat of falling back under Taliban rule, just as Americans found it nearly 20 years ago.
For Biden and some of the American principals in the US and NATO war in Afghanistan, the answer to whether it was worth the cost often comes down to parsing.
Read: Biden orders 1,000 more troops to aid Afghanistan departure
There were the first years of the war when Americans broke up Osama bin Laden's al-Qaida in Afghanistan and routed the Taliban government that had hosted the terrorist network.
That succeeded.
The proof is clear, says Douglas Lute, White House czar for the war during the George W Bush and Barack Obama administrations, and a retired lieutenant general: Al-Qaida has not been able to mount a major attack on the West since 2005.
"We have decimated al-Qaida in that region, in Afghanistan and Pakistan," Lute says.
But after that came the grinding second phase of the war. The US fears of a Taliban rebound whenever Americans eventually pulled out meant that service members kept getting sent back in, racking up more close calls, injuries and dead comrades.
Lute and some others argue that what the second half of the war bought was time – a grace period for Afghanistan's government, security forces and civil society to try to build enough strength to survive on their own.
Quality of life in some ways did improve, modernising under the Western occupation, even as the millions of dollars the US poured into Afghanistan fed corruption. Infant mortality rates fell by half. In 2005, fewer than one in four Afghans had access to electricity. By 2019, nearly all did.
The second half of the war allowed Afghan women, in particular, opportunities entirely denied them under the Taliban, so that more than one in three teenage girls – their whole lives spent under the protection of Western forces – today can read and write.
Read:Taliban sweep across Afghanistan's south, take 4 more cities
But it is that longest, second phase of the war that looks on the verge of complete failure now.
The US war left the Taliban undefeated and failed to secure a political settlement. Taliban forces this past week have swept across two-thirds of the country and captured provincial capitals, on the path of victory before US combat forces even complete their pullout. On many fronts, the Taliban are rolling over Afghan security forces that US and NATO forces spent two decades working to build.
This swift advance sets up a last stand in Kabul, where most Afghans live. It threatens to clamp the country under the Taliban's strict interpretation of religious law, erasing much of the gains.
Richard Boucher, assistant secretary of state for Central Asia during much of the war's first decade, says the criticism was largely not of the conflict itself but because it went on so long. "It was the expansion of war aims, to try to create a government that was capable of stopping any future attacks."
America expended the most lives and dollars on the most inconclusive years of the war.
The strain of fighting two post-9/11 wars at once with an all-volunteer military meant that more than half of the 2.8 million American servicemen and women who deployed to Afghanistan or Iraq served two or more times, according to the Costs of War project at Brown University.
The repeated deployments contributed to disability rates in those veterans that are more than double that of Vietnam veterans, says Linda Bilmes, a senior lecturer in public policy at Harvard University.
Linda calculates the US will spend more than $2 trillion just caring for and supporting Afghanistan and Iraq veterans as they age, with costs peaking 30 years to 40 years from now.
Read: Taliban take much of provincial capital in south Afghanistan
That is on top of $1 trillion in Pentagon and State Department costs in Afghanistan since 2001. Because the US borrowed rather than raised taxes to pay for the Afghanistan and Iraq wars, interest payments are estimated to cost succeeding generations of Americans trillions of dollars more still.
Annual combat deaths peaked around the time of the war's midpoint, as Obama tried a final surge of forces to defeat the Taliban. In all, 2,448 American troops, 1,144 service members from NATO and other allied countries, more than 47,000 Afghan civilians and at least 66,000 Afghan military and police died, according to the Pentagon and the Costs of War project.
All the while, a succession of US commanders tried new strategies, acronyms and slogans in fighting a Taliban insurgency.