When former President Barack Obama pulled the U.S. out of Iraq in 2011, I barely noticed it, which is odd, since I spent a year there after the 2003 invasion. It struck me only after the fact, when I returned to help a Sunni party in 2014 elections, that we’d essentially turned the country over to Iran. But…

The Iraqi form of government we helped them craft in 2004-5 endured. There are still elections, and there is still power sharing. Abuses by the pro-Tehran wing of the majority Shi’a against the Sunnis eventually flared up into violence and ISIS was born. Yet, through international cooperation, ISIS was countered and substantially diminished as a threat.

That all contrasts sharply with what we are seeing today in Afghanistan. After nearly 6,000 Americans were killed and over trillions of dollars spent on security operations and good works, we don’t even get to keep an embassy. It is cruelly ironic, because Afghanistan began as the good war.

Unlike the Iraq war, which was premised on intelligence later found faulty and in some cases fraudulent, we invaded Afghanistan because attacks on the U.S. homeland were planned there, and the attackers enjoyed a safe haven among the Taliban. It’s hard to imagine a clearer case for war. The occupation that stretched on for two decades was intended to prevent a Taliban return to power.

At the State Department, I worked for an undersecretary who was deeply involved in the largely successful efforts to educate and empower young Afghan women. Bright spots aside, the challenges were always clear. Afghanistan is known as the graveyard of empires for a reason. The Soviets left limping in the late 1980s, only to implode entirely several years later. The British lost nearly 5,000 soldiers and mercenaries there in a negotiated retreat no less in the 1840s.

For the sake of those who gave everything there; though, we could and should have left something behind — other than the weapons the Taliban are picking up now. Just as the image of the falling man Sept. 11 will always be seared into the memory of those who saw it, the images of Afghan civilians falling to their death after clinging onto the landing gear of departing U.S. C-17s will always haunt us.

The consequences of America’s history with Afghanistan don’t all land on President Biden’s shoulders, but the mishandling of our exit does, for two reasons. First, Biden was part of the administration that pulled out of Iraq, he had a basis for knowing better. Secondly, we were told from the start what a competent, top-drawer national security team Biden assembled versus the yahoos under Trump.

Too little thought or effort was put into leaving with dignity.

The Trump administration put into motion the current withdrawal and even invited the Taliban to Camp David.

However, one of the few things Trump was straightforward about was his commitment to getting the U.S. out of the forever wars. Even though the die was cast, blaming our departure on the lack of will among the Afghans, as Biden did in his remarks to the nation Monday, seems to spit in the eyes of those who bravely took a chance on the new government and worked alongside us when it was anything but safe for them to do so.

There is no such thing as an “over the horizon” counter-terror strategy, as Biden suggested we’d now pursue. Recall the flak Bill Maher took well before 9/11 when he called the U.S. “cowardly” for lobbing missiles into Afghanistan from distant ships. Yet, we’re back there now.

After Vietnam, we were supposed to have learned a lesson about propping up corrupt regimes that shared our enemies. After the Iranian revolution, we were supposed to have learned not to underestimate the threat of radical Islamists.

After Afghanistan, the world has now learned a lesson about us. As a friend returning from Kabul last week wrote at the airport, “It’s very hard not to feel ashamed to be American right now.”

In 2018, we threw the staunchly pro-American Kurds under the bus. Today we’re leaving the Afghans who bet on us behind. No, we couldn’t have stayed much longer, but we could have left smarter, and more nobly. As of the Ides of August, to borrow a phrase from veteran Afghan watcher and activist Sarah Chayes, the American century is over.

Sam Patten is a recovering political consultant who was raised in Knox County and worked for Maine’s last three Republican senators.