The UK Government has received assurances from the Taliban that anybody wishing to leave Afghanistan after 31 August will be allowed to do so.
But there have been fears over the potentially thousands of Afghans who may have been eligible for resettlement schemes, who could not make it to Kabul airport for evacuation or were not processed in time.
Prime Minister Boris Johnson said on Sunday that if the Taliban regime wanted diplomatic recognition and aid funding, they would have to ensure "safe passage" for those who want to leave.
And in a joint statement with the US and more than 90 other countries, it was confirmed that the Taliban had said anyone who wished to leave the country could do so.
The joint statement said: "We have received assurances from the Taliban that all foreign nationals and any Afghan citizen with travel authorisation from our countries will be allowed to proceed in a safe and orderly manner to points of departure and travel outside the country."
Watch: Afghanistan – end of evacuation 'not a moment of celebration'.
It comes after 15,000 people were evacuated from Afghanistan by UK troops over the course of nearly two weeks in Operation Pitting, which is believed to be the largest evacuation mission since the Second World War.
British ambassador to Afghanistan Sir Laurie Bristow, who had remained in the country and relocated the embassy to Kabul airport to process as many evacuees as possible, arrived back in the UK on Sunday.
He vowed to continue to help British nationals and Afghans who remain in the country and still need help.
Speaking on the runway at RAF Brize Norton in Oxfordshire, he said: "We've had to leave Afghanistan for now and the embassy will operate from Qatar for the time being.
"We will continue to stand by the people of Afghanistan, working on humanitarian, diplomatic and security work, and, above all, bringing to the UK Afghans and British nationals who still need our support, and we will be putting pressure on the Taliban to allow safe passage for those people.
"We will reopen the embassy as soon as we can. We will do everything we can to protect the gains of the last 20 years and above all to help the Afghan people achieve the security and the peace that they deserve."