Seeing the last British and American troops leave Afghanistan in such ignominious circumstances was a sobering moment for anyone who cares about liberal values and open societies.

President Biden said America’s only vital national interest in Afghanistan was to prevent a terrorist attack. But even by that most narrow of definitions he - and we - have failed.

The result of this chaotic, hurried withdrawal has been to hand the country back to the very government that sheltered the 9/11 bombers.

The truth, however, is that 457 British service men and women did not lose their lives simply to reduce the risk of a terrorist attack.

Nor did they support the dispiriting isolationism of ’America First’ of President Trump to which his successor appears to be pandering.

Our servicemen and women died in defence of a set of deeply-held values that said girls should be entitled to the same education as boys, courts should be independent of clerics and journalists should not be imprisoned if they speak truth to power.

If President Biden believes in those values too, it is time we heard it.

And it is time we heard the same from the British government too, because although it is not possible to stay in Afghanistan without American support, we are the second power in a Western Alliance that for all the failures of this week - and the failures of Iraq - has delivered more prosperity, more democracy and more respect for human rights in the past 100 years than at any time in human history.

Those gains are now at risk, not just because of the catastrophe of this week but because of the rise of an authoritarian and wealthy China that actively opposes our belief in open societies.

Freedom House says we have had 15 consecutive years of decline in the number of free countries and Reporters without Borders say press freedom has been declining since 2013 with the number of journalists imprisoned last year now reaching nearly 300.

We are proud of our country not just because of what we have achieved, nor simply our status as one of the wealthier countries on the planet - but because of what we stand for.

So when those values are under threat, when the Atlantic partnership appears to be withering, we should stop at nothing to rebuild it.

That means investing in our armed services, reversing the aid cut, developing our own technology industries and rebuilding our global alliances.

It means making sure we do find a way to get out those Afghani friends of Britain who risked their lives, and those of their families, by working for us when we were there.

There has been criticism of the government - and particularly my former department the Foreign Office - this week, but the truth is the decision on Afghanistan was forced on us unwillingly by our closest friend.

Such a fault line between allies is highly dangerous going forward.

Britain’s foreign secretary Ernest Bevin played a pivotal role in setting up NATO in 1949.

Even though our global position is different today, we still have one of the world’s biggest economies and the largest military in Europe.

Strengthening the western alliance to prevent a similar debacle must surely be our top foreign policy challenge.