Afghanistan is "heading towards civil war" as the UK prepares to withdraw its citizens, allies and troops, the defence secretary has said.
Ben Wallace told BBC Breakfast that it was likely that poverty and terrorism would increase in the country.
But he said the UK would have the right to intervene if terror plots against it were planned from Afghanistan.
Mr Wallace blamed former US President Donald Trump's "rotten deal" with the Taliban in 2020 for the withdrawal.
The defence secretary said around 600 troops were being sent to Afghanistan to ensure the safe return of about 500 Foreign Office and other UK government officials, along with around 3,000 British citizens working in other roles, such as security guards for aid agencies.
He said about 2,000 Afghan interpreters and "other people we have an obligation to" would also be transported to the UK, joining about 3,000 who have already been taken out of the country.
With the withdrawal facing criticism from former military figures and Tory backbenchers, Mr Wallace rejected the suggestion that the UK's 20 years in the region had been a failure.
He pointed to the three million women and girls who had received an education during the time the Taliban had been forced out of power. "You can't take away from people that education," he said.
But he said he had "concerns" about reports by BBC journalists in Afghanistan of "pretty horrendous things on the ground", as tens of thousands of people have had to flee their homes and the Taliban is beginning to reassert its hardline rule over its captured cities.
"I think we are heading towards a civil war," he said, adding that as states fail, both poverty and terrorism grows.
But Mr Wallace said that the UK could act if Afghanistan again began to harbour terrorists who presented an international threat - as it did when it offered a safe haven to Osama Bin Laden and his al-Qaeda group, responsible for the 11 September attacks which killed thousands in New York.
"UK forces retain the capability to defend its citizens" if nations do not take action against terrorists in their midst, he said.
"Under international law we have the right to defend our country against imminent threats."
The deal signed between Mr Trump and the Taliban in February 2020 pledged to withdraw US troops and those of Nato allies in 14 months if the Taliban upheld promises to proceed with national peace talks and not allow al-Qaeda or other militants to operate in areas it controlled.
The Taliban stopped attacks on international forces as part of the agreement, but continued to fight the Afghan government. In recent days, it has seized several key cities as it advanced across the country.
Mr Wallace said the deal had "undermined the government of the day" in Afghanistan.
Wendy Rayner, whose husband Peter died in action in Helmand province in 2010, said the withdrawal undermined the sacrifice of soldiers who lost their lives.
"My husband died to give them a better life, and by them not having a better life, it's taken away his fight," she told the BBC.
"All these young people in Afghanistan that are having their families slaughtered because nobody cares, because we've just left them in the lurch - it's just going to create another terror threat. They're going to hate us and I don't blame them."
'A world tragedy'
Former defence minister and Tory MP Johnny Mercer, who served in Afghanistan, said it was "deeply humiliating" to see the military's work over two decades overturned so quickly by the Taliban.
But he said it was "simply not true" that the UK could not continue to support Afghan security forces after the US departure.
"The political will to see through enduring support to Afghanistan has not been there and a lot of people are going to die because of that," he said.
"It's a world tragedy and we are going to reap the repercussions of this over many years to come."
Home Secretary Priti Patel said the government had "serious, serious concerns" about the Taliban advance and said Afghanistan was "a tragedy unfolding, a humanitarian crisis emerging".
As several European countries suspended deportation of rejected Afghan asylum seekers due to the worsening security situation, Ms Patel said the UK government's deportation policy was "always under review".
She said the government was focused on its "enormous resettlement programme" of UK and Afghan nationals who have worked for the British government.
But Labour's shadow foreign secretary Lisa Nandy called on the prime minister and foreign secretary to "come out of hiding" and demonstrate a clear strategy to address the crisis in Afghanistan.
There must be "no red tape or delays" to resettling Afghan nationals who assisted the British military in the UK, Ms Nandy said.
Former International Development Secretary Rory Stewart said the withdrawal was "an absolute betrayal... totally heartbreaking and totally unnecessary".
"There was no reason for us to do this, and by doing this we've broken Afghanistan in a matter of weeks," he said.
Tom Tugendhat, chairman of the Foreign Affairs Committee, said Afghan forces had "stepped up" in recent years, allowing Nato to end its involvement in the fighting and bringing an end to British combat casualties.
"Now we've just pulled the rug from under them," he said. "We've taken away their air support, taken away their logistics."
Mr Tugendhat said the war had cost £40bn and taken the lives of more than 450 British soldiers, but he said the future commitment would have only been for 750 soldiers as part of a 10,000-strong Nato force, assisting 400,000 Afghan security forces.
He contrasted the decision in Afghanistan to post-war Germany, where UK troops were only withdrawn in 1991. "Endurance matters, staying matters, being an ally matters," Mr Tugendhat said.