Shortly after the Taliban took over Afghanistan, Russia's ambassador to Afghanistan Dmitry Zhirnov praised the Taliban's conduct and said the group, still officially designated a terrorist organisation in Russia, had made Kabul safer in the first 24 hours than it had been under the previous authorities.
The comment is a stark contrast to the last time hardliners came to power in Afghanistan in 1992 when Moscow struggled to evacuate its embassy under fire after a disastrous decade-long war.
So, what is Russia's relationship with the Taliban? From foes to friends again -- here's a look at their relationship and how the current events will affect both nations.
From the pages of history
The Soviet Union invaded Afghanistan on 24 December, 1979 under the pretext of upholding the Soviet-Afghan Friendship Treaty.
The subsequent 10-year war, which has been described as ‘Russia’s Vietnam’, saw thousands of troops being sent in, millions being spent, all ultimately resulting in a final retreat.
The Taliban, which means “students” in the Pashto language, emerged in 1994 around the southern Afghan city of Kandahar. It was one of the factions fighting a civil war for control of the country following the withdrawal of the Soviet Union and the subsequent collapse of the government.
It originally drew members from so-called “mujahideen” fighters who, with support from the United States, repelled Soviet forces in the 1980s.
Within the space of two years, the Taliban had gained sole control over most of the country, proclaiming an Islamic Emirate in 1996 with a harsh interpretation of Islamic law. Other mujahideen groups retreated to the north of the country.
Mutual contempt and distrust
In 2000, when the Taliban controlled two-thirds of Afghanistan, it recognised the independence of Chechnya, allowed Chechen separatists to train on their territory and declared a “jihad” on Russia.
The Kremlin still bans the Taliban as a “terrorist organisation”; Russian courts have sentenced half a dozen of its adherents to jail.
In October 2010, Afghan president Hamid Karzai reprimanded Russia after its forces entered the country without permission. He also stated that Russia has "violated Afghan sovereignty" in a joint mission with United States agents.
What Russia’s concerns are
Analysts say the Kremlin wants to protect its interests in Central Asia, where it has several military bases and is keen to avoid instability and potential terrorism spreading through a region on its doorstep.
At this point, the primary concern of Russia is their own security; they want to be sure that Afghanistan’s post-US withdrawal insurgency or political instability will not cross their borders.
Russia is also concerned about an expansion of the Islamic State (Daesh) presence in Afghanistan, and fears that stalled diplomatic negotiations could give Daesh time to concentrate its presence. A Daesh foothold in Afghanistan could pose a threat to the peace in the North Caucasus region of Russia.
Curbing the damaging flow of narcotics out of Afghanistan, through Central Asia and on to markets in Russia, is another priority for Moscow.
What is in favour for Russia?
Zamir Kabulov, Russian President Vladimir Putin’s special representative for Afghanistan, told RIA the Taliban had guaranteed security for the Russian embassy, suggesting the Russians had open lines of communication with the insurgents as they marched on the capital.
Furthermore, Russia has raised the Taliban's international profile when its foreign ministry gave the militant group a seat at the conference table in Moscow, alongside members of Afghanistan’s High Peace Council and civil society.
More importantly, the pull-out of the American troops gives Russia a chance to reassert itself in the region.
Russia will be eager to take advantage of the unstable security situation in the region by shoring up its influence in Central Asia, said Temur Umarov, an expert on Central Asia at the Carnegie Moscow Center think tank.
“Central Asia was slipping away a little bit from Russia’s orbit of influence toward China but Russia is the only country that will actually guarantee military support to countries like Tajikistan and Uzbekistan. It has deep-rooted military connections with Central Asia,” he said to the Moscow Times.
Alexander Baunov of the Carnegie Moscow Center said Russia now believed the Taliban have changed since the last time it was in power in the 1990s when it gave shelter to Al Qaeda.
"Moscow does not see this version of the Mujahideen as its enemy," he told AFP.
But this all depends on whether security in Afghanistan can be assured. For Russia, then, much is riding on what happens next in Afghanistan.