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, with the Taliban launching attacks and taking more territory in recent weeks.
The surge coincides with the end of Nato's 20-year military mission in the country.
The vast majority of remaining foreign forces in Afghanistan have been withdrawn ahead of a September deadline, and there are concerns that the Afghan military 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 al-Qaeda or any other extremist group to operate in the areas they control.