Believe it or not, there was a time when some Americans thought we had won the war in Afghanistan.

Just a few weeks after the 9/11 attacks on New York and Washington, D.C., U.S. troops and their allies routed Afghanistan's Taliban government, which had given shelter to terrorist mastermind Osama bin Laden. The country was already known as the "graveyard of empires," thanks to its defeat of the Soviet Union a mere 12 years earlier — and its liberation from the British Empire in 1919 — but some American officials and journalists took the speed of their initial victory as a sign they had avoided the missteps of their predecessors.

"Nobody predicted the U.S.-led war would dislodge the Taliban so fast — least of all the veterans of the Soviet Union's bloody 10-year Afghan war," a reporter for Radio Free Europe wrote in November 2001. "So why has the U.S. encountered surprising success where the Soviets met failure?"

The question, as it turned out, was dreadfully premature — the Soviets, after all, left Afghanistan only after fighting in that country for nine years. But then-Secretary of Defense Donald Rumsfeld offered a moralizing answer: "The Soviet Union was an expansionist power that took over other countries and wanted Afghanistan," he said. "The United States is not."

It was never that simple, of course.

President Biden on Wednesday announced that the United States will fully withdraw all of its troops from Afghanistan by September 11, the 20th anniversary of the attacks that started the war. "I'm now the fourth United States president to preside over American troop presence in Afghanistan. Two Republicans, two Democrats," Biden said. "I will not pass this responsibility on to a fifth."

The announcement puts America on the list of Afghanistan's failed occupiers. There are many reasons for that failure. But any discussion of those reasons has to include an examination of that brand of hubris known as "American Exceptionalism." U.S. leaders thought they could succeed where others had not. They were wrong.

In 2001, the lessons of the Soviet war in Afghanistan were still relatively fresh, flashing like warning signs for Americans. ''The idea they sent us in with, it was just like the Americans,'' one former Soviet soldier told the New York Times. ''When we entered Afghanistan, we were going to fight terrorism, too.''

The intentions of Soviet leaders probably weren't so benign. Despite Rumsfeld's assertions, though, that didn't matter. Afghanistan had already proven an easy country to invade, but a terrible place for outsiders to win a war.

"The Soviets initially were quite successful. They occupied the country in a matter of days," defense expert Ted Galen Carpenter said. "It was when they tried to transform Afghanistan into a socialist society and prop up a puppet government — really engaging in their own version of nation-building — that they ran into all sorts of trouble."

History repeated itself. The problem for the United States in Afghanistan was not in winning military victories. It came down to an Afghan government that has consistently failed to secure the country or govern competently and honestly.

"The weakness of state institutions, malign actions of power-brokers, widespread corruption and abuse of power by various officials … have given Afghans little reason to support their government," Gen. Stanley McChrystal, then the commander of U.S. forces in the country, wrote in a 2009 memorandum. "This crisis of confidence, coupled with a distinct lack of economic and educational opportunity, has created fertile ground for the insurgency." Rather than fix that problem, U.S. officials made it worse by sending more money to the country — then turning a blind eye to the worst corruption because it was committed by its allies. At home, we debated troop levels every now and again, but it has been years since anybody seriously proposed a strategy for leaving Afghanistan better than we found it.

No wonder America failed.

Biden's detractors fear the U.S. withdrawal will lead to a bloody civil war in Afghanistan. They may not be wrong. Even with the occupation, however, more than 93,000 Afghan civilians — including women and children — have been killed or injured during the last 11 years. Critics also worry that Afghanistan will become home again for future terrorist attacks. Let's hope their fears are unfounded. It can't be forgotten that the war, now ending in a whimper, began with the worst horror most living Americans had ever seen or experienced. But a generation has passed since that awful day. It is time to move forward.