Both countries issued alerts late on Wednesday as thousands of people are still waiting inside and outside the airport waiting to fly out.
More than 82,000 have been airlifted from Kabul, which fell to the Taliban 10 days ago.
Countries are rushing to evacuate people by a 31 August deadline.
The Taliban have opposed extending the deadline but also promised to allow foreigners and Afghans to leave the country beyond 31 August, according to US Secretary of State Antony Blinken.
In an alert on Wednesday, the US State Department told those waiting at the Abbey Gate, East Gate or North Gate to “leave immediately”.
Earlier, the UK issued similar advice asking people there to “move away to a safe location and await further advice”.
The Foreign Office said that the security situation in Afghanistan “remains volatile” adding that there was “an ongoing and high threat of a terrorist attack”.
Neither the US or UK gave any further information on the security threat.
In a speech on Tuesday, US President Joe Biden said the US-controlled airlift would have to come to an end soon because of an increasing threat from the Islamic State group in Afghanistan.
About 19,000 people have been evacuated on US-organised flights in the past 24 hours, Mr Blinken said on Wednesday, with airlifts stepped up in recent days amid scenes of chaos.
He said that the US was still on track to complete operations at Kabul airport by the end of the month.
“Only the United States could organise and execute a mission of this scale and this complexity,” he told reporters in Washington.
“The Taliban have made public and private commitments to provide and permit safe passage for Americans, for third-country nationals and Afghans at risk past August 31st,” he said.
He added that the US would help those who wanted to leave Afghanistan “not just during the duration of our evacuation and relocation mission, but every day thereafter”.
Up to 1,500 US nationals could still be in the country and the administration was making exhaustive efforts to trace them, the secretary of state said.
The CIA and the US military have been carrying out clandestine operations to extract Americans using helicopters and ground troops, US and other officials have told the Wall Street Journal.
The perilous operations have been both inside and outside of Kabul, the paper says.
The Pentagon has said 10,000 people are still waiting to be evacuated from Kabul airport by US aircraft. There are fears for thousands more Afghans who are desperate to leave but cannot reach the site.
BBC correspondents say many of those being turned back by the Taliban at the airport gates appear to have travel papers.
President Joe Biden tweeted that the US would “do everything” to “provide safe evacuation”.
The UK said its evacuation operation was moving at “significant pace”, with some 1,200 people flown out on Wednesday.
Foreign Secretary Dominic Raab said his government would use “every hour and day that we’ve got left” to fly British nationals and eligible Afghans out.
Kabul airport is currently being defended by 5,800 US and 1,000 British troops.