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 coincides with the end of Nato's 20-year military mission.
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.