WASHINGTON (AP) -- It took only two months for U.S. invaders to topple the Taliban in Afghanistan in 2001, a seemingly tidy success against a government that had given refuge to 9/11 mastermind Osama bin Laden. Twenty years later, the United States is withdrawing -- visions of victory long vanished and an ascendant Taliban arguably within reach of restoring their rule.
Afghanistan proved to be a lesson in the limits of America's military power.
It demonstrated the seeming paradox that it is possible to win the battles and still lose the war. Or at least that a technologically superior force can kill more efficiently than its enemy yet fail to achieve a final result resembling victory.
It showed that in the 21st century, it takes more than a conquering army, even one as well armed as America's, to convert the overthrow of a government, even one as tenuous as the Taliban's, into a lasting success. It showed that it takes, at a minimum, an understanding of local politics, history and culture that the Americans were slow to acquire.
The United States underestimated how much its presence as an occupier fueled Taliban motivation to fight and limited the Kabul government's ability to unite. Although bin Laden eventually was killed and his al-Qaida network blunted as an international threat, Afghans are still caught in a cycle of violence and misrule with no end in sight.
In his book, "The American War in Afghanistan, A History," Carter Malkasian, a former adviser to senior U.S. military leaders in Afghanistan and Washington, says one reason for the futility of the American effort was the influence of Islam and resistance to foreign occupation. Those were factors, he says, that were not well understood by the Americans.
"The very presence of Americans in Afghanistan trod on what it meant to be Afghan," he wrote. "It prodded men and women to defend their honor, their religion, and their home. It dared young men to fight. It animated the Taliban. It sapped the will of Afghan soldiers and police."
The U.S. military may have missed opportunities to stabilize Afghanistan in the early years after ousting the Taliban, which had run the country as an international pariah since 1996. But the bigger question is whether the military, after its initial success, was miscast in the lead role of transporting Afghanistan from chaos to stability.
The U.S. military does not fight wars entirely on its own terms. It operates through civilian direction. Although civilian leaders may be accused of having overreached with visions of building Afghanistan into a democracy capable of defending itself, the military eventually embraced that goal. Claims by senior military officers of having "turned a corner" toward success in Afghanistan were repeated so regularly that critics wondered whether the military was going in circles.
Karl Eikenberry, a retired Army lieutenant general with a rare combination of high-level military and diplomatic experience in Afghanistan, said the U.S. military initially balked at an open-ended mission of nation-building in an impoverished country traumatized by decades of civil war.
"But it warmed to the task," he said, and the United States became further entangled as it pursued a military strategy not informed by realistic policy debates in Washington about what outcome was achievable and at what cost.
By numbers alone, the costs were enormous. Tens of thousands of Afghan government forces and civilians were killed. The United States lost more than 2,440 troops, and the allies lost more than 1,100. The U.S. spent hundreds of billions, and even after the withdrawal, the Biden administration plans to ask Congress to spend billions more in support of Afghan soldiers -- even to continue paying their salaries.
The war, conceived in the traumatic aftermath of the hijacked plane attacks that killed nearly 3,000 people on 9/11, devolved from the triumphant moment of ousting the Taliban from Kabul to nearly a decade of revived insurgency, starting in 2005. The killing of bin Laden in 2011 seemed like an opportunity to wind down the war, but it dragged on.
Experts disagree on the central reason the U.S. failed to stop a Taliban resurgence after its initial losses, but a contributing factor was a decision by President George W. Bush to invade Iraq in 2003. Within a few years that war became so all-consuming that Afghanistan was officially relegated to a secondary priority.
"Making it a sideshow was a fatal choice," Eikenberry said.
A full decade after bin Laden's demise, President Joe Biden decided that continuing the war was senseless. He announced in April that he was ending it, arguing that waiting for an ideal moment to leave was a formula for never leaving, and citing the pullout commitment the Trump administration had made to the Taliban in 2020. The last troops are to depart by Aug. 31.
Biden argued that the central purpose of starting the war -- to crush al-Qaida and to prevent Afghanistan from again being a breeding ground for another attack on the United States -- had been achieved, leaving no reason to further risk U.S. troops. The risk that remains is a collapse of the Afghan government and a return of extremist threats, although Biden has promised to keep a U.S. diplomatic presence in Kabul and to push for a peace settlement.
On the day American forces began the war, Oct. 7, 2001, then-Defense Secretary Donald Rumsfeld suggested it would be open-ended, but no one anticipated it turning into the longest war in U.S. history.
"While our raids today focus on the Taliban and the foreign terrorists in Afghanistan, our aim remains much broader," he told reporters. "Our objective is to defeat those who use terrorism and those who house or support them." He made clear that this was a global war on terrorism, not just a fight in Afghanistan.
Yet even as talk of a war on terrorism faded, the war in Afghanistan persisted, long after victory fell out of reach.
"In the end, we prosecuted the war in Afghanistan because we could," Eikenberry said. "With no peer competitor, a volunteer force, and deficit spending, we had the luxury strategically and politically of fighting a forever war."