In announcing his decision to withdraw all remaining US troops from Afghanistan, President Joe Biden declared that ‘it’s time to end America’s longest war.’ The wording of the President’s announcement left little room for backtracking so his decision appears to be definitive. It’s also necessary and long overdue, if not without risk.

But it will not actually ‘end’ the war that began just weeks after the 9/11 terrorist attacks when US special operations forces and CIA paramilitary units entered Afghanistan. The conflict that Americans are accustomed to calling the Afghanistan War will continue, albeit without any overt US military involvement. As the Americans and their coalition partners vacate the scene, the fate of the nation that the United States has spent some $2 trillion vainly attempting to pacify and transform will once more fall to the Afghan people. No doubt to the accompaniment of considerable violence, they will decide whether the Western-installed government in Kabul will survive or whether the Taliban will return to power.

Of course, that war began in 2001 as an effort to oust the Taliban regime then ruling Afghanistan. That authorities in Washington — both the present administration and its predecessor — now deem the Taliban to be a fit negotiating partner is one expression of how this longest war in US history has not panned out as expected. The very real possibility that the US military departure will find the Taliban once more calling the shots in Kabul hints at the full extent of that failure.

While no one in the White House or at the State Department, much less the Pentagon, will say so aloud, the fact is that the vaunted US military has suffered a resounding defeat in Afghanistan. There is no disguising the fact that it has failed to accomplish the mission assigned. It surrenders the field of battle to an enemy that now sees final victory in sight. Even without dramatic video footage of overloaded helicopters lifting off from the roof of the US embassy, the likely outcome of the Afghanistan War bears comparison with the Vietnam debacle of a half-century ago.

Yet while Vietnam scarred the American psyche, it did not appreciably affect the nation’s global posture. After the fall of Saigon, waging the Cold War — the previous ‘forever war’ — remained the focal point of US grand strategy. The opening to Red China engineered by Nixon and Kissinger in the 1970s had rearranged the chessboard to US advantage (even if today their gambit has lost some of its luster). Of equal importance, huge increases in military spending during the 1980s enabled the armed services to repair much of the damage they had sustained in Vietnam. When the Berlin Wall came down at the end of that decade, Vietnam had not been forgotten, but it had been eclipsed by what appeared to be a victory of cosmic proportions.

Thus were planted the seeds of the next ‘forever war’ — the very one that Biden now claims to be ending.

The conclusion of the Cold War persuaded policy elites that the United States had ascended to the status of sole superpower. Within the officer corps, priority number one was to preserve US military primacy. More than a few members of the civilian elite had other ideas. In those circles, priority number one was to put US military power to work solving problems. A military of incomparable quality and matchless capabilities seemed an ideal instrument for liberating the oppressed, protecting the abused, or punishing ne’er do wells.

Who was there to say nay? As Madeleine Albright famously put it to Gen. Colin Powell in the early days of the Clinton administration, ‘What’s the point of having this superb military you’re always talking about if we can’t use it?’

The ensuing period of bipartisan military activism reached its zenith in 2003 when the United States invaded Iraq, thereby effectively consigning the ongoing Afghanistan War to the status of afterthought. The subsequent ‘forever war,’ which over the course of nearly two decades extended to an array of countries beyond Iraq and Afghanistan, has not gone well. Its chief effect has been to expose US military primacy as a chimera. For proof, we need look no further than President Biden’s decision to pull the plug on Afghanistan.

Americans should be grateful to the volunteers who serve our country in uniform, thereby allowing the vast majority of us to sit on the sidelines and tend to other matters. But the civic responsibility to ‘support the troops’ should by now include an appreciation that they are not invincible. The principal military lesson of the last 20 years is this: against highly motivated irregulars intent on expelling foreign occupiers from their homeland, said occupiers — that is, us — fight at a severe disadvantage. A useful corollary that harkens back to Vietnam: a wise nation avoids involvement in those situations in the first place.

In announcing his decision to withdraw from Afghanistan, Biden declared that ‘it’s time for American troops to come home.’ Whether that statement hints at an emerging Biden Doctrine with broader application remains to be seen. If it does, American citizens of all political persuasions should rejoice.

Unlike Vietnam, in other words, the dismal outcome of the Afghanistan War should prompt a wholesale reexamination of US grand strategy. Our de facto defeat in Central Asia makes it impossible to ignore any longer the self-destructive consequences of post-Cold War and post-9/11 military activism across a broad swathe of the Greater Middle East. Biden’s withdrawal announcement prompted the New York Times to pose this question: ‘What Did the US Get for $2 Trillion in Afghanistan?’ The irrefutably honest answer: next to nothing, certainly nothing even remotely worth the lives of the more than 2,400 GIs killed there along with more than 20,000 Americans wounded.

The coming end of the American war in Afghanistan offers an occasion to adjust our expectations of what US forces can and should be expected to do. Washington’s penchant for recklessly dispatching the troops on futile missions to liberate the oppressed, protect the abused, and punish ne’er do wells should end. Henceforth, US military policy should focus on preventing war. Rather than invading and occupying distant countries, US forces should defend, deter, and contain. This narrower remit will facilitate a reconfiguration of basic US national security policy to address looming threats — climate change offering one example — for which there is no feasible military solution.

What did the US get in return for all that it expended in Afghanistan? Perhaps only this: an opportunity to learn enough to avoid making the same mistakes yet again.

Andrew Bacevich is president of the Quincy Institute for Responsible Statecraft. His new book After the Apocalypse: America’s Role in a World Transformed is due out in June.