The US pullout from the Pentagon's once mighty Bagram Air Base in the dead of night, while Taliban fighters pour across the country, looks a lot like a military defeat. Back home, President Joe Biden sees a political win.

The US government calls its Afghan exit a "drawdown," not a retreat. And it insists it will continue to support the increasingly vulnerable Afghan government from a distance.

However, the rapid, secretive extraction of all but a handful of the final US troops leaves no doubt about Biden's one true priority: ending 20 years of fruitless warfare against a Taliban insurgency that could not be beaten.

The runway at the US air base of Bagram is empty and the Americans are gone The runway at the US air base of Bagram is empty and the Americans are gone Photo: AFP / WAKIL KOHSAR

Defeat or not, but the White House is blunt about the basic reality.

Afghanistan is "a war that the president continues to feel does not have a military solution," press secretary Jen Psaki told reporters Tuesday.

Afghan policemen in Kandahar province, where the Taliban are increasingly strong Afghan policemen in Kandahar province, where the Taliban are increasingly strong Photo: AFP / Javed Tanveer

Biden originally set a deadline for the withdrawal of September 11 -- the 20th anniversary of the 9/11 attacks that first triggered US invasion of Afghanistan.

By Tuesday, though, 90 percent of the troops were already gone. The last will be out by the end of August, the Pentagon said.

President of Afghanistan Ashraf Ghani meets with US President Joe Biden at the White House in June President of Afghanistan Ashraf Ghani meets with US President Joe Biden at the White House in June Photo: AFP / Nicholas Kamm

As quickly as the American presence vanishes, so the Taliban force advances, sometimes taking over swaths of territory without a fight, sometimes engaging in bloody clashes.

The Afghan government claims that hundreds of Taliban died in the latest fighting, but there have also been signs of potential collapse in the US-built national army. On Monday, a thousand soldiers simply fled across the border into Tajikistan.

The top US military commander in Afghanistan, General Austin Miller, has delivered an unusually blunt warning of chaotic civil war -- a "concern for the world."

US Marines in Afghanistan in 2009, not knowing the war would continue more than another decade US Marines in Afghanistan in 2009, not knowing the war would continue more than another decade Photo: AFP / MANPREET ROMANA

Biden's predecessor Donald Trump set the exit in motion when he struck a deal with the Taliban where US troops would get out by May 1. Biden, despite disagreeing with Trump on most things, changed the date but embraced the idea.

"I am now the fourth American president to preside over an American troop presence in Afghanistan," Biden said in April. "I will not pass this responsibility to a fifth."

For all the gloom and doom inside Afghanistan, Biden has a firm focus on an entirely different picture back home: overwhelming public support for stopping the so-called "forever war."

Amid warnings that the Taliban could commit atrocities, ban girls' education, or even renew its relationship with al-Qaeda, some say Biden should rethink his plans. Republican Senator Lindsey Graham calls the withdrawal "a disaster in the making."

But John Mueller, a political science professor and foreign policy expert at Ohio State University, says that whatever the aftermath of the war, the most likely reaction from Americans will be to shrug.

"I don't think the likely political ramifications are very great one way or the other. No one got shattered from the cosmic debacle in 1975 in Vietnam and there were no repercussions for Reagan's withdrawal from Lebanon in 1983 or Clinton's from Somalia in 1993," he said.

"Americans are likely to give it little attention. They are good at that and are already working on it."

Gordon Adams, a professor at American University's School of International Service, said Biden was right "to cut bait."

"I do not think there is a personal risk to Biden," Adams said. "Afghanistan is not a popular war."