MOSCOW—Russia has a fine line to tread when it hosts a Taliban delegation at international talks in Moscow on Wednesday: staying on good terms with the new regime in Kabul while preventing an influx of refugees and a broader Islamist movement gaining ground in what used to be the Soviet Union.

From Eastern Europe to the Central Asian republics to its south, Russia has long tried to exert its influence over the former Soviet space.

But...

MOSCOW—Russia has a fine line to tread when it hosts a Taliban delegation at international talks in Moscow on Wednesday: staying on good terms with the new regime in Kabul while preventing an influx of refugees and a broader Islamist movement gaining ground in what used to be the Soviet Union.

From Eastern Europe to the Central Asian republics to its south, Russia has long tried to exert its influence over the former Soviet space.

But since the Taliban seized control of Afghanistan amid the U.S.’s chaotic withdrawal, coming up with a strategy for engaging the new leadership in Kabul has become a rising priority for the Kremlin as it tries to maintain political stability across its backyard, analysts said.

The balancing act has taken varying forms.

Moscow’s ambassador was quick to meet with Taliban representatives days after they came to power and, unlike many Western nations, Russia has kept its embassy in Kabul open. Russia has also called on the international community to unfreeze more than $9 billion in Afghan reserves held in overseas accounts and to fund humanitarian aid efforts.

One complication is the fact that Russia officially lists the Taliban as a terrorist group despite inviting them to Wednesday’s talks, in which India, Pakistan, Iran and China are also planning to participate. The U.S. won’t be attending, the State Department said, citing logistical reasons.

Russian President Vladimir Putin met last week with leaders of several former Soviet republics.

Photo: Kremlin Pool/Zuma Press

“What Russia wants to show is that it does have a solid working relationship with the new authorities in Afghanistan,” said Samuel Ramani, associate fellow at the Royal United Services Institute, a London-based defense and security think tank. “It’s a way of flattering them, giving them legitimacy without recognizing them.”

Ultimately, Mr. Ramani said, Russia aims to make itself an effective conduit between the Taliban and rival Afghan factions, as well as other countries, and slow the Islamists’ creep into Moscow’s traditional sphere of influence.

Russia’s Ministry of Foreign Affairs said this week that the participants would discuss the military and political situation in Afghanistan and the creation of an inclusive government. They would also touch upon consolidating efforts of the international community to avert a humanitarian crisis in the country, the ministry said.

Specialists in Russia-Afghanistan relations said another key topic for Moscow would be preventing the conflict-ridden and cash-strapped nation from becoming a base for terrorist groups.

“It’s like the Taliban is on probation, from the Russian point of view,” said Andrey Kazantsev, a specialist on Afghanistan and Central Asia at the Moscow State Institute of International Relations. “They are being given the chance to solve Afghanistan issues, fulfill their promises not to attack Central Asia, and keep different terrorist organizations out of Afghanistan.”

A Russia-led security alliance has been holding military exercises near Tajikistan’s border with Afghanistan.

Photo: Peter Kovalev/Zuma Press

Russian President Vladimir Putin said Friday that while there is a need to interact with the Taliban, there shouldn’t be a rush to formally recognize the movement as Afghanistan’s new leaders. He told a videoconference including the leaders of several former Soviet republics, including Afghan neighbors Tajikistan, Uzbekistan and Turkmenistan, that Moscow’s main objective was to normalize the economic and political situation in Afghanistan and limit the danger of instability spilling over its borders.

The Kremlin appears especially concerned with the impact on Tajikistan, which shares an almost 900-mile border with Afghanistan. Relations between the two countries have quickly deteriorated since the Taliban took over, with Tajik officials warning that ethnic-Tajik militants who fought alongside the Taliban might try to infiltrate Tajikistan.

There are over 15,000 Afghan refugees in Tajikistan, with 500 to 600 people wanting to cross over each day, according to Saimumin Yatimov, chairman of Tajikistan’s State Committee for National Security, who said that smuggling is a growing risk.

“The situation on the Tajik-Afghan state border is quite difficult,” he told a meeting of security chiefs from former Soviet republics.

Russia also fears that a flood of Afghan refugees into Central Asia could provide cover for Islamist militants to infiltrate countries in the region.

Afghan refugees file through the town of Khorugh near the Tajik-Afghan border.

Photo: Tass/Zuma Press

“It’s well known that the very fact of the victory of the Taliban, irrespective of any Taliban intentions, has caused something like a great inspiration for different radical Islamists throughout the former Soviet space,” Mr. Kazantsev at the Moscow institute said.

Moscow appears to be leaving little to chance.

The Soviet Union fought a nearly decadelong war in Afghanistan, departing in 1989 after some 15,000 Soviet troops had been killed and tens of thousands wounded. To avoid being dragged into another potential conflict, analysts said, Moscow appeared focused on trying to bolster the defenses of Tajikistan and other countries in the region.

Since the Taliban takeover, Moscow has held military exercises in Tajikistan and shored up its hardware capabilities at its 201st military base there. According to the Russian state news agency, TASS, this is Russia’s largest military facility outside its borders and includes armored, artillery and reconnaissance units, air defense forces, radiation, chemical and biological protection, and signal-communications troops.

A Russia-led security alliance including Belarus, Armenia, Kazakhstan, Kyrgyzstan and Tajikistan is also currently holding military exercises near the Afghan border in Tajikistan.

“These are exercises that are very much needed,” presidential spokesman Dmitry Peskov told reporters last week.

Write to Ann M. Simmons at ann.simmons@wsj.com