KABUL (Reuters) - Still haunted by its own disastrous war in Afghanistan, Russia is tiptoeing back into Kabul's affairs ahead of a gradual withdrawal of NATO troops that could leave a dangerous power vacuum in what was once a traditional sphere of influence.
Moscow has refused to send troops to the war, which is becomingly increasingly unpopular as it drags into its 10th year, but it has backed drug raids, and increased support for NATO and local forces. It has also showed interest in business deals as it vies to boost its clout in Afghanistan.
Russia has welcomed Afghan President Hamid Karzai twice in the past 12 months, where he directly asked his Russian counterpart Dmitry Medvedev for help with security.
Long indirectly involved in Afghan affairs through supporting foreign operations, Russia is now pursuing "independent engagement", said Vanda Felbab-Brown, an expert on Afghanistan and fellow at the Brookings Institution.
"Russia's primary objective is to avoid having civil war, instability and leakages into Central Asia and into Russia itself," Felbab-Brown told Reuters from Washington.
Moscow has also been courting Pakistan, seen as instrumental to peace plans in Afghanistan, where some 15,000 Soviet soldiers died fighting mujahideen insurgents before pulling out in 1989.
Russia agreed last year to expand on a transit deal to allow NATO to take armoured vehicles through its territory. It had already allowed the military alliance to ship food and fuel.
An agreement to supply the United States with 21 military helicopters is also expected to be completed by year-end.
"Russia certainly does not want America to remain in the region," said Fyodor Lukyanov, editor of the journal Russia in Global Affairs. "At the same time, there is also the concern that the U.S. departure, particularly a swift one, will make the situation much more difficult".
Moscow also hopes to be involved in several economic projects, including a proposed gas pipeline and hydroelectric power facilities in Kabul. Russia has said it would rebuild Soviet-era infrastructure, which it built in the 1950s-1970s, if the international community footed the bill.
Despite escalating violence, Washington and NATO have pledged to begin a gradual security transition from July as part of a plan that will see all foreign combat troops leave Afghanistan by the end of 2014.
Experts say the first transition phase -- to begin in seven areas -- is more about symbolism than substance, but agree the handover is still crucial to determining the readiness of Afghan forces.
Violence last year hit its worst levels since U.S.-backed Afghan forces overthrew the Taliban government in late 2001, but Washington and its allies have backed Karzai's peace plan, which includes negotiations with Taliban-led insurgents.
However, there is still little idea how that plan will work and the likelihood of more political uncertainty looms.
Still wary of a country at the heart of the "Great Game" -- the historic rivalry between Britain and Russia during the 19th and 20th centuries --, Moscow is now also driven by its fear of growing Islamism.
Russia is afraid the troop drawdown will allow militants to filter into the oil and gas-producing mainly Muslim countries of ex-Soviet Central Asia.
Last month the head of a Russia-dominated regional security bloc, the Collective Security Treaty Organisation (CSTO), warned member states that Afghan insurgent activity was already spreading to the bordering Central Asian countries.
"This is one of the main destabilising factors presenting a real threat to collective security in the Central Asian region," the CSTO's Nikolai Bordyuzha said in Moscow.
Moscow is so alarmed, security sources and analysts say, that it is in talks with Tajikistan -- whose southern border with Afghanistan is long and porous -- to send up to 3,000 Russian border guards to protect the country from a spillover of violence.
Uzbekistan and Turkmenistan also border Afghanistan.
"It is possible we could see a resurgence of the Taliban, and the Islamist movements in Central Asia might be emboldened by this," said Gemma Ferst from the London-based Eurasia Group.
Twenty years after the fall of the Soviet Union, homegrown Islamist movements now exist in all Central Asian countries, Ferst added, and links to the international radical community have already been established.
Russia also has worries closer to home.
The Kremlin is waging an uphill battle with Islamist insurgents in its mainly Muslim North Caucasus region, underpinned by Soviet-era deportations and two separatist wars in Chechnya since 1994.
Potential chaos in Afghanistan after foreign troops leave could encourage Russia's rebels, who are bent on carving out an independent Islamic state and stage near-daily attacks across the North Caucasus.
Escalating their campaign, they also said they carried out the suicide bombings that killed a total of 77 people in Moscow's busiest airport in January and on the Moscow metro last year.
"There are fears that (violence) might reverberate into the North Caucasus, and how moral encouragement from Afghanistan could fuel salafism and separatism there," said Felbab-Brown, referring to the ultra-conservative branch of Islam that the Caucasus rebels follow.
Afghan militants have openly supported the North Caucasus in the past: the Taliban government recognised Chechnya as independent in 2000 and even set up an embassy in Kabul.
Russia's crippling drugs crisis and a looming HIV/AIDS epidemic have also reignited Moscow's interest in Afghan intervention. A quarter of all Afghan heroin reaches Russia through Central Asia, making it the largest per capita user in the world with up to 3 million addicts.
Though Russia has vowed repeats of a joint raid with the U.S. last year, in which they destroyed four drug labs and a tonne of heroin near the Afghan border with Pakistan, it also disagrees with its Cold War foe over local drug output.
"The drug trade feeds into militant activity, which poses a risk for Central Asia, and this is of course something that motivates us," said anti-drugs tsar Viktor Ivanov, referring to Russia's desire to destroy poppy crops.
The United States has said eradicating poppy plantations would push disgruntled Afghan farmers into insurgents' hands.
Additional reporting by Thomas Grove and Steve Gutterman, editing by Miral Fahmy