The easy, obvious and probably inevitable legacy of America’s two-decade-long war in Afghanistan is the recognition that there are limits to U.S. military power, especially when it comes to altering the culture and internal politics of other countries.

This conclusion, shared by politicians as disparate as President Biden and former president Donald Trump, isn’t entirely wrong. But it also fails to recognize the missed opportunities, the blunders and even some of the successes of the longest war in American history, according to senior military officers who fought in the conflict and civilian officials who tried to rebuild Afghanistan.

It is a view of the Afghanistan war that distorts more than it clarifies and potentially sets up the United States for failures the next time it is pulled into a guerrilla conflict, these officials said.

Government interview records obtained by The Washington Post reveal U.S. officials misled the American public about the Afghanistan war for nearly two decades. (Joyce Lee/The Washington Post)

On Wednesday, Biden is expected to announce that he will withdraw all American troops from Afghanistan by Sept. 11. The decision will also bring to a close U.S. involvement in a conflict that has spanned four presidents. A few immediate outcomes seem likely.

The Taliban — once derided as an implacable terrorist threat that needed to be crushed — will almost certainly seize a far greater role in the future Afghan government than U.S. officials were willing to contemplate when the war started. Some analysts worry that the U.S. exit could precipitate the collapse of the struggling Afghan army and a worsening of the country’s civil war as various warlords fight for power. And Afghan civilians, particularly women who enjoyed new rights and freedoms after the Taliban’s initial defeat in 2001, will probably suffer immensely.

The immediate temptation will be to brand it all a terrible, wasteful failure that could have been avoided if U.S. forces had simply toppled the Taliban in 2001 and quickly returned home. Such a view, however, denies the political pressure that successive presidents felt to stay in the country to ensure that terrorist groups such as al-Qaeda or the Islamic State couldn’t use it as a launchpad to attack the United States or its people again.

It also ignores a key lesson of history: Sometimes even great powers have to fight guerrilla wars.

“The messy, larger lesson is how hard it was for presidents to get out,” said Carter Malkasian, a top adviser to senior military officers in Afghanistan and author of a history of the American war in Afghanistan, due out this summer. Before Biden, both President Barack Obama and Trump vowed to end the war, but they failed.

More recently, the rise of China, the danger posed by the coronavirus pandemic, the threat posed by global warming and the collapse of the Islamic State have all made terrorism seem like less of a pressing threat.

“Up until this point it may have been really impossible to leave,” Malkasian said.

These days, most senior military officials seem inclined to ignore the war in Afghanistan. Inside the Pentagon, the buzzy topic is “Great Power Competition,” which is essentially a way of talking about possible future conflicts with China or Russia.

The true legacy of the Afghanistan war could well be set by a handful of senior officers and civilian advisers, such as Malkasian, who have spent the better part of the past 20 years prosecuting it.

To Malkasian, who served alongside grunts in Garmsir province and advised four-star commanders in Kabul, the main lesson of Afghanistan for U.S. forces should be that changing societies, eliminating corruption and building institutions takes a long time. Instead of surging more than 30,000 troops, as Obama did in 2009, Malkasian argued that commanders fighting future wars like Afghanistan should opt for a smaller, less visible presence that might be more politically palatable over the long term.

“You’re not going to have great or fast success,” he said. “So maybe the best you can do is manage the problem and muddle through. . . . If staying long isn’t worth it, then maybe you should stay out.”

Retired Lt. Col. John Nagl, who helped to write the Army’s counterinsurgency doctrine in 2006, echoed part of Malkasian’s analysis. “Counterinsurgency warfare is really hard,” he said. “It is a generational task.”

But he disagreed with Malkasian’s suggestion that fewer troops might have been a better long-term option. In Nagl’s view, Afghanistan was a winnable war until senior officials in the George W. Bush administration diverted key resources to an unnecessary war in Iraq.

Infantry brigades that were being held back for the coming invasion of Iraq could’ve helped capture Osama bin Laden as he fled to Pakistan, potentially altering the course of the conflict. The additional soldiers might also have been used to speed training of the Afghan army or prevent the early return of the Taliban, Nagl said.

One big legacy of the Afghanistan conflict probably will involve how the United States views its enemies. In the early days of the conflict, when the Taliban was in disarray and seemed to be interested in a political settlement, the Bush administration rejected talks. The Taliban was treated as a terrorist group and its entreaties rejected.

Today, that approach looks foolish.

“Negotiate early and negotiate often,” said Stephen Biddle, a senior fellow at the Council on Foreign Relations. “You don’t win a war by destroying an opposing army and occupying their capital. You win by making possible a settlement that was not possible before the conflict started.”

After two decades of outlasting U.S. firepower and forces, the Taliban does not seem to be in much of a mood to compromise. Peace talks have gone nowhere. Today, the U.S. retreat from Afghanistan looks more like a surrender to exhaustion than a political settlement with a former enemy.

The weariness with the Afghanistan war has fed the view that the United States failed, a perspective that rankles Matt Sherman, who spent more than a decade advising U.S. commanders and ambassadors in Iraq and Afghanistan. “I can’t think that I was part of a failed mission,” Sherman said. “I refuse to accept it because I know a lot of good work was done.”

The main goal of the conflict, Sherman said, was to protect the United States from another major terrorist attack similar to 9/11. On that score, the Afghanistan war succeeded. “In my mind it was good enough,” he said. “Whether it was worth the cost in terms of money and lives lost, I don’t know.”

Some historians say that it’s too early to ponder the legacy of the Afghanistan war. “This is going to be an emotional moment and will have echoes of Vietnam,” said Eliot Cohen, a historian and former Bush administration official. “Now isn’t a time when you can really process lessons, and it’d be foolish for anyone to try.”

The immediate takeaway seems to be that the United States shouldn’t try to use its military to battle insurgents or change the internal dynamics of other societies. It’s advice akin to the age-old axiom to “never get involved in a land war in Asia.”

Cohen insisted that it was also the sort of advice that does more harm than good, letting America’s political and military leaders off the hook for mistakes they made in failing to train the Afghan army, build lasting Afghan institutions, recognize when they were losing, or understand the culture and politics of the place in which they were waging war.

“That’s a cheap lesson,” Cohen said. “If Germany reverted to Nazism after World War II, you could say the same thing.”