Former UK PM Tony Blair has described the US withdrawal from Afghanistan as "tragic, dangerous, and unnecessary" in his first statement since the fall of Kabul to the Taliban last Sunday.
He said the decision was made "in obedience to an imbecilic slogan about ending 'the forever wars'".
Mr Blair led the UK when it invaded the country alongside the US in 2001, following the 11 September attacks.
He said the exit of allied troops would have Jihadist groups "cheering".
Mr Blair also said that Britain has a "moral obligation" to stay in Afghanistan until "all those who need to be are evacuated".
The former Labour leader wrote on his website: "We must evacuate and give sanctuary to those to whom we have responsibility - those Afghans who helped us and stood by us and have a right to demand we stand by them."
He added this should not be done "grudgingly but out of a deep sense of humanity and responsibility".
Mr Blair said the decision to withdraw from Afghanistan had been driven by politics, and referred to ending "the forever wars" - a phrase used by US President Joe Biden during his election campaign.
"We didn't need to do it. We chose to do it," he wrote.
"We did it in obedience to an imbecilic political slogan about ending 'the forever wars', as if our engagement in 2021 was remotely comparable to our commitment 20 or even 10 years ago, and in circumstances in which troop numbers had declined to a minimum and no allied soldier had lost their life in combat for 18 months."
The US has a planned deadline of 31 August for withdrawal - but President Biden has said troops may stay past this date to help with evacuations.
Mr Blair admitted mistakes had been made over Afghanistan, but "the reaction to our mistakes has been unfortunately further mistakes". He said while "imperfect", the "real gains over the past 20 years" were now likely to be lost.
The withdrawal would have "every jihadist group around the world cheering", he said.
Russia, China and Iran will take advantage, he added. "Anyone given commitments by Western leaders will understandably regard them as unstable currency."
President Biden has vowed that "any American who wants to come home, we will get you home", but has described the evacuation as one of the "most difficult airlifts in history".
Mr Blair's article comes as shadow foreign secretary Lisa Nandy has urged her government counterpart Dominic Raab to step up efforts to get British and eligible Afghans to the UK.
She said she had heard of people being beaten, shot at or raped while trying to get documentation in Kabul.
The Foreign Office said it was trying to get people out as fast as possible, with more than 3,000 people having been evacuated from the country since Sunday.
Defence Secretary Ben Wallace said, in an article in the Mail on Sunday, the West's exit from Afghanistan was "unedifying" and would have "consequences for us all for years to come".
He said there was "no time to lose" to get people out of the country but added the US would have his complete support if it chose to push back the deadline for leaving.