Around 600 troops will be deployed on a short-term basis after the Taliban seized several cities.
Around 600 UK troops are to be sent to Afghanistan to assist British nationals to leave, the government has announced.
It comes as the Taliban has seized the cities of Ghazni and Herat – taking control of 11 provincial capitals in less than a week.
Military personnel will provide protection and help relocate UK nationals, Afghan staff and interpreters.
On Friday the Foreign Office advised all British nationals to leave.
It is estimated that around 4,000 British citizens are still in the country.
Defence Secretary Ben Wallace said the security of British nationals, military personnel and former Afghan staff was the government’s first priority and that it “must do everything we can to ensure their safety”.
Mr Wallace said deployment of troops, who will be arriving in the coming days, was a “pre-planned phase” and was to “enable the next step of leaving”.
But the Ministry of Defence (MoD) said the additional deployment was “in light of the increasing violence and rapidly deteriorating security environment in the country”.
The UK’s ambassador to Afghanistan, Sir Laurie Bristow, will continue to lead a small team in Afghanistan which will relocate within Kabul to a more secure location, the MoD said.
By Paul Adams, BBC diplomatic correspondent
It was always likely, this close to the end of the Nato mission to Afghanistan, that events would appear to accelerate. We are, after all, getting out.
But as they made their careful arrangements, planners did not necessarily anticipate the speed of the Taliban’s advance, or the weakness of an Afghan military the US and its allies spent almost two decades building up.
What they wanted was an orderly withdrawal, with the Afghan government able to hold its own.
What we’re facing, instead, is something altogether more chaotic.
Perverse though it might sound, sending troops in to get people out was always going to be part of the plan.
So too was the relocation of the British embassy to a more secure (and as yet undisclosed) location.
But the withdrawal of an unspecified number of embassy personnel, with the Americans making a similar move, is clearly being driven by events on the ground.
With US officials warning that the Afghan government could fall in as little as 30 days (a worst case scenario, it has to be noted), these feel like the crisis plans everyone hoped they wouldn’t have to use.
Labour’s shadow defence secretary John Healey said the MoD had his party’s full backing on sending troops to help the evacuation.
“We share widespread dismay that the security situation in Afghanistan is deteriorating so much faster than forecast,” he said, adding that while the UK’s forces were withdrawing “we cannot walk away from the people of Afghanistan”.
Conservative chair of the Commons Foreign Select Committee Tom Tugendhat, who served in Afghanistan, tweeted that “needing reinforcements to keep the door open as you leave is a sure sign of failure”.
Tory colleague Tobias Ellwood, who chairs the Defence Select Committee and also served in the British Army, told the BBC we “should really be reconsidering what’s going on” in Afghanistan, warning that the withdrawal of troops was leaving the country to a “massive humanitarian disaster” and said that we would see “terrorism raise its ugly head again”.
The US has also said it is sending 3,000 military troops to the airport in Kabul to help evacuate a “significant” amount of embassy staff on special flights.
The Taliban has moved with speed, seizing new territories and cities almost daily, as the US and other foreign troops withdraw from Afghanistan after 20 years of military operations.
They now control around a third of the country’s regional cities and most of northern Afghanistan.
On Thursday the Taliban took control of Herat, the third largest city, and there is heavy fighting in Kandahar, the second largest.
Meanwhile the taking of the strategically important Ghazni increases the likelihood the group could take the capital Kabul.
Thousands of civilians have been displaced and fled to Kabul to try to escape the fighting.
And the UN has estimated more than 1,000 civilians have been killed in Afghanistan in the past month.
Makeshift camps have been established on the outskirts of the capital, while many others have reportedly been sleeping on the streets or in abandoned warehouses.
The UK’s Afghan Relocations and Assistance Policy (ARAP) has already supported more than 3,100 former Afghan staff and their families to move to the UK – with 1,800 of them arriving in the last few weeks, the MoD said.