More than 1,000 Afghan soldiers have fled to neighbouring Tajikistan after clashing with Taliban militants, officials have said.
The troops retreated over the border to "save their own lives", according to a statement by Tajikistan's border guard.
Violence has risen in Afghanistan and the Taliban have been making significant gains, particularly in the north of the country, in recent weeks.
The surge comes as the US, UK and allies withdraw after 20 years.
The vast majority of remaining foreign forces in Afghanistan have left ahead of a September deadline. There are concerns that the Afghan military, who were supposed to take over security in the country, will collapse.
Under a deal with the Taliban, the US and its Nato allies agreed to withdraw all troops in return for a commitment by the militants not to allow any extremist group to operate in the areas they control.
But the Taliban did not agree to stop fighting Afghan forces, and now reportedly control about a third of the country.
The retreat is the third time Afghan soldiers have fled to Tajikistan over the past three days and the fifth case over the past fortnight. In total, nearly 1,600 soldiers have crossed the border.
The latest group of Afghan troops sought refuge early on Monday morning after fighting with militants during the night, Tajikistan's National Security Committee said.
Badakhshan and Takhar provinces, which border Tajikistan, have seen a rapid Taliban advance.
"The Taliban cut off all the roads and these people had nowhere to go but to cross the border," one senior Afghan official told Reuters on Monday.
Zabihullah Atiq, a parliamentarian from Badakhshan, said the troops had used various routes to flee. Tajik border guards said Afghan soldiers were being provided with shelter and food, but further details were not available.
Army morale sinks as violence spreads
By Kawoon Khamoosh, BBC News
With the new surge in violence across the country, Afghan forces are facing an unprecedented level of combat in the absence of foreign troops.
Government officials have been tweeting non-stop to keep soldiers motivated by underlying their sacrifices. But much of the troops' motivation disappears amid news of retreat, collapse of key districts and casualties.
Military officials in Kabul have talked about "tactical retreat" whenever insurgents made gains, but we hear from commanders in the battlefield about a lack of ammunition, and delays in sending support.
In Badakhshan province, where the government lost significant territory in recent days, local sources say many government officials "escaped" to Kabul way before Taliban attacks.
Not only can this dishearten soldiers, but it also raises the bigger question of the loyalty of high-ranking officials in peace talks. Will political leaders - whose families already reside abroad - remain in the country if full-scale civil war erupts?
President Ashraf Ghani insists that Afghan security forces are fully capable of keeping insurgents at bay, but there have also been reports of more soldiers seeking refuge in Pakistan and Uzbekistan to escape the fighting.
Neighbouring countries are bracing themselves for a potential influx of refugees if the fighting continues to intensify.
Taliban spokesman Suhail Shaheen told the BBC the group was not responsible for the recent increase in violence. He insisted that many districts had fallen to the Taliban through mediation after Afghan soldiers refused to fight.
For the people of Afghanistan, it is a worrying time, says Lyse Doucet, the BBC's chief international correspondent. The Taliban, who have been accused of various human rights and cultural abuses, support Islamic punishments - such as public executions of convicted murderers - as well as banning television, music and cinema, and disapproving of girls over 10 going to school.
"They are uncertain about uncertain about their own lives and the futures of their families," she says.
Zahra, a 25-year-old resident of Kabul, is among those concerned about the future.
"People are expecting a wider than ever war. A lot of people in Kabul fear that the Taliban might reach us at any time," she told BBC OS on World Service radio.
Jamshid, a student at Kabul University, said he did not plan to stay in the country if the Taliban took power.
There are also growing concerns about how to protect diplomatic missions in Afghanistan.
Russia on Monday announced that it had temporarily suspended operations at its consulate in the northern city of Mazar-e-Sharif because of the deteriorating security situation. Envoy Zamir Kabulov said Afghan troops had surrendered too many districts, making the situation unstable.
Turkey and Iran have also suspended operations in the city, moving diplomats to Kabul, according to reports.
US-led forces ousted the Taliban from power in Afghanistan in 2001. The group had been harbouring Osama Bin Laden and other al-Qaeda figures linked to the 9/11 attacks in the US that triggered the invasion. However, it has gradually regained enough strength to seize territory again.
The Taliban entered direct talks with the US in 2018, and President Joe Biden has said the American pull-out is justified as US forces have made sure Afghanistan cannot become a base for foreign jihadists to plot against the West again.
However, former Afghan President Hamid Karzai told the BBC he believed the Nato and US military mission there had failed in defeating terrorism and extremism.
He called on both the Afghan government and the Taliban to "sit down and talk as soon as possible for peace".