To read the Prime Minister’s statement to MPs on the United Kingdom’s withdrawal from Afghanistan, delivered to Parliament on July 8, is to be reminded that we originally invaded that country for very narrow reasons:

“It was in the mountain ranges of this sanctuary that al-Qaeda operated a formidable network of terrorist training camps, drilling and indoctrinating thousands of recruits. The terrorists who acquired their murderous skills in Afghanistan or who were organised from its soil dispersed across the world, inflicting bloodshed and tragedy on three continents.”

He then paints a picture of decisive achievement:

“Today, thankfully, the situation is very different. The training camps have been destroyed. What remains of al-Qaeda’s leadership no longer resides in Afghanistan and no terrorist attacks against western targets have been mounted from Afghan soil since 2001. We should never lose sight of those essential facts. On the morning after 11 September, few would have predicted that no more terrorist attacks on that scale would be launched from Afghanistan in the next 20 years.”

All of this is true, as far as it goes. And yet for all that, the conclusion of the West’s great Afghan effort is a tragedy and a failure. Because the United States and its allies did not settle for uprooting al-Qaeda and installing a regime in Kabul capable of keeping them out. Instead the goal was the wholesale transformation of the country along Western lines, most notably by extending education and equal rights to women.

It is easy for people like me, who only really became aware of Afghanistan after 9/11, to over-estimate how hubristic this mission must have seemed to people with longer memories of the country. Within living memory, at least up until the 1973 coup that toppled the monarchy, the country was part of the backpacker trail and, in the Atlantic’s words, “on a path toward a more open, prosperous society”. Photographs of the country from the 1950s and 1960s, like those from neighbouring Iran, remind us that the arc of history can, if it exists, be bent backwards.

But this only makes the failure of the American-led effort to build a new Afghanistan all the more damning. Trillions of dollars have been invested, and the occupiers have had two decades to try and build a new society. Yet the Taliban look set to restore the Islamic Emirate (which had ruled the country a mere five years before the 2001 invasion) in a matter of months.

It is that failure of nation-building, rather than the withdrawal itself, that truly indicts the USA and her allies. Given that the goal was never to occupy Afghanistan forever, withdrawal was always going to have to happen at some point. If we couldn’t build a self-sustaining Afghan society in 20 years, it is not obvious that we could have done it in 30 or 50. The sunk costs fallacy is no grounds for ongoing operations: opponents of withdrawal need to spell out what they expect to achieve by staying, and how, and on what timescale.

Perhaps this failure was an artefact of that brief end-of-history moment when it appeared that the West in general, and America in particular, were without serious challengers, and there was thus time and treasure to spend on utopian projects. Maybe today’s Washington, facing renewed great power competition from Beijing, would have been willing to operate on Cold War logic, and contented itself with installing a pro-Western regime – perhaps the monarchy – that could hold down the Taliban and modernise slowly, rather than trying to transplant our entire system at once.

Maybe next time too Western governments will do more to challenge the tech-fixated doctrines of their military leaders, and instead try to give an occupied nation security forces it can equip and operate on its own resources, rather than one crippled the moment expensive American contractors (who have doubtless made a pretty profit on the contracts) are withdrawn, as Tom Tugendhat pointed out.

That’s if there is a next time, of course. There is scarcely much appetite in NATO these days for the wholesale remaking of other nations.

It may be too that those who keep the faith of liberal interventionism can’t reconcile themselves to supporting regimes which, whilst hopefully better than those they replace, do not live up to the high ideals of the interventionists. If we could have turned Afghanistan into a sort of modern Rhodesia – an non-democratic but broadly Western-style government, which would let the NGOs run the girls’ schools whilst waging an effective but brutal counter-insurgency forever war – who would have settled for that?

Likewise, perhaps the hopelessness of Ben Wallace’s efforts to form a coalition to stick it out without the US will prompt British politicians to rethink a defence posture which is built around the assumption of American support.

Until then, we can only get our people out, do right by the Afghans endangered by helping us, and in Washington’s case plead with the Taliban not to sack their embassy. What a total, abject failure.