Residents of an Uzbek city near the Afghan border woke up to the prospect of having the Taliban as neighbours once again as the militant group's military takeover of Afghanistan loomed.

Former Soviet Uzbekistan is one of three Central Asian countries that share a border with Afghanistan.

Termez -- a quiet provincial capital with wide Soviet-style streets -- appeared calm despite a night of mayhem when dozens of Afghan troops fleeing the Taliban came over the Uzbek border at a crossing near the city.

The 84 soldiers entered Uzbekistan after the fall of a key northern Afghan city this weekend, the Uzbek foreign ministry said.

It later said a separate concentration of Afghan government forces had built up on the Afghan side of a bridge over the Amu Darya river, which separates the two countries. They "voluntarily" vacated the bridge after talks, Tashkent said.

Mazar-i-Sharif, an Afghan provincial capital only 100 kilometres from Termez by road, was conquered by the insurgents this weekend.

Residents of Termez, a city of about 200,000 people, told AFP they were wary of the Taliban coming to power next door.

"They were never our friends and they are unlikely to be," said 66-year-old Safar Tursunov as he went about his weekend errands.

"Uzbekistan is a prospering country. We don't need neighbours like them."

In the years since the Taliban last held power in 2001, the ancient city of Termez has enjoyed a growing trade relationship with Afghanistan, epitomised by the railway linking it to Mazar-i-Sharif.

Uzbekistan said on Sunday that it had evacuated its railway workers living on the Afghan side.

Uzbek soldiers guard a checkpoint, two kilometres from Friendship Bridge over the Amu Darya river, which separates Uzbekistan and Afghanistan near Termez
Uzbek soldiers guard a checkpoint, two kilometres from Friendship Bridge over the Amu Darya river, which separates Uzbekistan and Afghanistan near Termez AFP / Temur ISMAILOV

Both Uzbekistan and neighbouring Turkmenistan have held high-level talks with the Taliban touching on security and the future of regional infrastructure projects.

Tajikistan, Afghanistan's third Central Asian neighbour, has said that it had not held talks with the group. Its leader has complained about "terrorist groups" taking control of the border with his mountainous country.

The Taliban has moved to reassure its northern neighbours that it has no designs on them, despite the fact that several Central Asian countries offered logistical support to Washington's war effort.

Olimzhon Usmonov, a 24-year-old Termez resident said he hoped the conflict in Afghanistan would remain "an internal confrontation".

"We have faith in our armed forces," Usmonov said. "I don't think the Taliban can attack Uzbekistan."

Termez is also home to about 2,000 Afghan citizens, many of whom reside in the city for business reasons.

One Termez-based Afghan, Abdulkadyr Hamidi, 70, told AFP that his community had struggled to sleep at night amid the relentless sweep of Taliban victories.

"Uzbekistan gave us an opportunity to live here. But our children and grandchildren are there and we are worried about their fate," Hamidi said.

"Every hour, death awaits us."

Footage shared on social media on Saturday night appeared to show dozens of Uzbek military vehicles taking up position on the "Friendship Bridge" separating the two countries.

But AFP was unable to verify the footage as police guarded a checkpoint two kilometres from the border.