correction

An earlier version of this article described Afghanistan's border with Tajikistan as 500 miles. It is more than 800 miles. The article has been corrected.

More than 1,000 Afghan soldiers fled into neighboring Tajikistan early Monday to escape clashes with Taliban insurgents who have mounted an aggressive offensive as NATO forces withdraw, according to Tajik border officials.

Citing a statement from Tajikistan’s border authority, Tajik state-run news agency Khovar said Monday that 1,037 Afghan servicemen crossed the border from Afghanistan’s Badakhshan province “to save the lives of their personnel.”

Tajik President Emomali Rahmon later Monday ordered the mobilization of 20,000 reserve troops to the border, according to a statement on the presidential website. Tajik authorities have repeatedly said they will not interfere in internal Afghan matters.

Russian President Vladimir Putin, a critical ally for Rahmon, said Monday that Russian forces in the former Soviet state will help secure the border with Afghanistan if needed.

The influx was the third wave of Afghan soldiers to flee into Tajikistan in recent days and the fifth in two weeks, bringing the total to nearly 1,600, according to the BBC.

The Afghan Ministry of Defense did not immediately respond to a request for comment.

In a statement on Twitter, Defense Ministry spokesman Fawad Aman said “vast areas” of Badakhshan province were cleared of Taliban fighters.

But Ahmad Javed, a member of Badakhshan’s provincial council, told The Washington Post that the “situation is unfortunately not good.”

Javed said that all but one of Badakhshan’s 28 districts have fallen into Taliban control while Faizabad, the provincial capital, is surrounded by the Taliban.

People “worry Taliban may enter the city at any moment,” he said. Afghan reinforcements arrived in Faizabad on Sunday night, he added.

The Taliban has been rapidly retaking territory across northern Afghanistan, including areas along the more than 800-mile border with Tajikistan. Thousands of militia members — including ethnic Tajiks in Afghanistan — and armed citizens have rushed to join Afghan forces to fight the insurgents.

U.S. intelligence analysts have warned that the Afghan government could fall swiftly after U.S. troops completely pull out of Afghanistan. President Biden set Sept. 11 as the withdrawal deadline, although hundreds of troops have already departed, and the U.S. military last week handed control of Bagram air base, its most important airfield in Afghanistan, to Afghan forces.

American troops withdrew from their main military base in Afghanistan on July 2. (Reuters)

Afghan officials have insisted that they are prepared to retain control and beat back the Taliban.

But many Afghans are looking to leave the country amid fears of a return to the Taliban’s repressive rule. The ultraconservative group imposes an extreme interpretation of Islamic law that limits the rights of women and girls to learn, work and play sports, among other restrictions.

About 200,000 Afghans have been internally displaced this year, according to Indrika Ratwatte, Asia-Pacific bureau director for the U.N. High Commissioner for Refugees.

Aid agencies are also bracing for an influx of refugees in nearby countries — including Iran, Pakistan, Tajikistan, Uzbekistan and Turkey — which for decades have hosted several million Afghan refugees and are warning that they are not equipped to take in more.

Tajikistan, the poorest country in Central Asia, shares many linguistic and ethnic ties with Afghanistan. But the country, which is aligned with Russia, imposes restrictions on Afghan refugees, such as banning them from living in the capital, Dushanbe, and limiting them from working in certain sectors.

On Monday, Reuters reported that Tajikistan is considering setting up camps for Afghan refugees fleeing the expected rise in violence. Every month since April, about 1,000 Afghans who can afford tickets have flown to Dushanbe to seek asylum, according to Ratwatte.

In recent days, Uzbekistan has set up a tent to house an expected flow of Afghan refugees, Eurasianet reported.

Sharif Hassan in Kabul contributed to this report, which has been updated.