Boris Johnson has said the UK can be “extremely proud” of its role in Afghanistan, despite the situation in the country having “deteriorated”.
The UK will evacuate the “vast bulk” of its embassy staff in the coming days as the Taliban continues to advance.
The prime minister said there was “no military solution” after an emergency Cobra meeting on Friday afternoon.
On Thursday, the UK said it would send 600 troops to help evacuate British nationals and former Afghan staff.
Thousands of civilians have fled the Taliban onslaught, heading for the capital of Kabul.
The World Food Programme has warned that food shortages are “dire”, while the UN has urged Afghanistan’s neighbours to keep their borders open.
The militants now control about a third of Afghanistan’s provincial capitals, including Herat, Ghazni and Lashkar Gar.
Mr Johnson insisted there was no military solution following the gains made by the Taliban in recent days and said that a team of Home Office officials would be sent to step up efforts to relocate Afghans who worked for British forces in the country.
“It is very difficult obviously, but I think the UK can be extremely proud of what has been done in Afghanistan over the last 20 years,” he said.
The prime minister said that thanks to the efforts of the UK armed services there had been no al-Qaeda attacks on the West for “a very long time”.
He also added that three million girls and young women in Afghanistan had been educated who otherwise would not have been, during the last 20 years.
“I think we’ve got to be realistic about the abilities of the UK or any power to impose a military solution, a combat solution in Afghanistan,” Mr Johnson said.
“What we certainly can do is work with all our partners in the region and around the world who share an interest with us in preventing Afghanistan from once again becoming a breeding ground for terror.”
Earlier, Lisa Nandy, Labour’s shadow foreign secretary, told BBC Radio 4’s World At One programme there was “far more” the UK could do to support the people of Afghanistan and accused the government of “hiding”.
She warned the government that cross-party MPs could push to recall Parliament to hold the government to account if it did not show a clear strategy.
Ms Nandy said that people in the country felt “abandoned” and were looking to the US and UK for “a level of leadership”.