The Taliban have captured major border crossings with Iran and Turkmenistan in a sweeping offensive across northern Afghanistan, officials say.
The militants say they seized two key border towns - Islam Qala near Iran, and Torghundi bordering Turkmenistan.
Video footage appeared to show Taliban forces taking down the Afghan flag from the roof of a border customs office.
The Taliban are rapidly retaking land across Afghanistan as the US-led mission removes the last of its troops.
Taliban officials say their fighters have taken control of 85% of territory in Afghanistan - a claim impossible to independently verify and disputed by the government.
Other estimates have put the amount of territory the Taliban controls at more than a third of the country's 400 districts, including an arc of land from the Iranian border in the west to the frontier with China on the other side of the country.
The Americans earlier this week quietly departed from Bagram airfield, a sprawling base that was the centre of US operations in Afghanistan and once held tens of thousands of troops.
Afghan officials acknowledged the loss of the Islam Qala and Torghundi border crossings, both in Herat province.
The Islam Qala crossing is one of the biggest trade gateways into Iran, generating an estimated $20m (£14m) in monthly revenue for the government. The Torghundi border town is one of two trade gateways into Turkmenistan.
Afghan forces are trying to recapture the two border crossings, a government spokesperson said.
"All Afghan security forces including the border units are present in the area, and efforts are under way to recapture the site," interior ministry spokesman Tareq Arian told the AFP news agency.
Zabihullah Mujahid, a spokesman for the Taliban, said the Islam Qala crossing was "under our full control".
Reports said Taliban fighters had seized five districts in Herat without a fight.
Iranian media have widely shared this video, reportedly showing Taliban fighters taking down the flag of Afghanistan at the Islam Qala border crossing. pic.twitter.com/2s1SBeOoTq— Kian Sharifi (@KianSharifi) July 9, 2021
Earlier this week, more than 1,000 members of the Afghan security forces fled into Tajikistan, which lies north-east of Afghanistan, as the Taliban advanced around them.
Russia on Friday said the Taliban had taken control of about two-thirds of the Afghan-Tajik border in a swift advance. Russian foreign ministry spokeswoman Maria Zakharova said Moscow was urging all sides in Afghanistan to "show restraint".
The reports came hours after US President Joe Biden defended his administration's decision to withdraw from Afghanistan after 20 years of war.
"I will not send another generation of Americans to war in Afghanistan with no reasonable expectation of achieving a different outcome," Mr Biden said.
He admitted it was "highly unlikely" the Afghan government would be able to control the entire country.
Some US intelligence analysts fear the Taliban could seize control of the country within six months, according to an assessment distributed to officials in June.
Afghan President Ashraf Ghani has insisted that Afghan security forces are capable of keeping the Taliban at bay, and Afghan forces appear to have retaken lost ground in some areas.
According to officials, troops on Wednesday recaptured government buildings in the western city of Qala-e-Naw - the first major provincial capital entered by the Taliban in their latest offensive.
UK Chief of Defence Staff General Sir Nick Carter told the BBC's Today programme that one of three scenarios would likely unfold in Afghanistan.
Firstly, the Afghan government could "hold the ring, as it's demonstrating through holding all the provincial capitals at the moment", he said.
"The second scenario I think is a very sad scenario, where the country fractures and you see the government collapse. You see the Taliban perhaps controlling part of the country, and the other nationalities and ethnicities controlling other parts of the country, like we saw in the 1990s," he said.
"A third, more hopeful, scenario, is where you actually see a political compromise and talks occurring. US operations in Afghanistan will officially end on 31 August, but the vast majority of foreign troops have already left."
Peace talks between the government and the Taliban continue, but the talks have regularly stalled and failed to progress significantly.