For Viktor Ivanov, the road back to Kabul has taken two decades. He first arrived in Afghanistan in 1987 as a young KGB officer, back when the country was the southernmost outpost of the Soviet empire. When he returned last month, Kabul was the outpost of a very different empire—one run by reluctant imperialists in Washington keen to get out as soon as possible. Though the official reason for Ivanov's return was to aid U.S. antinarcotics efforts—he's now Russia's drug czar—his real goal in Afghanistan was clear: to help recover some of Russia's lost influence there. As his Russian Air Force plane began its descent into the Kabul airport, Ivanov raised a glass of champagne with his aides and boasted, "Russia is back."

A lot of history stands in the way of Russia'snew campaign. Local memories of the destruction wrought by the Soviets in their decade-long occupation remain fresh. But both the Afghans and the Americans have reasons to welcome Russia's reengagement. No one has a silver bullet for Afghanistan's rampaging drug trade, but with its vast intelligence assets across Central Asia and an operational group of Russian troops on the Afghan-Tajik border, Moscow could make a real difference. To win over the locals, the Russians have also offered to ramp up their involvement in the Afghan reconstruction, energy, and mineral sectors. Russian companies are currently negotiating to rebuild 142 Soviet-built installations across the country, including a $500 million deal to reconstruct hydroelectric plants in Naglu, Surobi, and Makhipar and a $500 million program to build wells and irrigation systems nationwide. Rosneft, the Russian state-owned oil and gas giant, has commissioned a study of gas fields in Djarkuduk and Shebarghan that could lead to contracts yielding $350 million a year. Russian air-transport contractors are already working for NATO and the Afghan government. But all this cooperation comes with a price: increased Russian influence in Kabul. Moscow makes no bones about this: it seeks nothing less than to "reclaim its geopolitical share of Afghanistan," says its ambassador, Andrey Avetisyan.

It might seem surprising, given Afghanistan's history as a Cold War battleground, that it's the Americans who invited the Russians back in. But sure enough, last year U.S. President Barack Obama and his Russian counterpart, Dmitry Medvedev, set up a series of contact groups on mutual security interests in the region. Ivanov and his U.S. counterpart, Gil Kerlikowske, have since sat down on many occasions to figure out ways Russia can help NATO choke off the Taliban's drug businesses.

The Russians have good reason to help. More than 130,000 Russians die each year of heroin addiction and its side effects, and about 120,000 more are jailed for drug-related crimes. Russia is the conduit for some $18 billion of heroin a year, making it both the biggest consumer and biggest transit country in the world. "It is useless to fight it inside our borders," says Ivanov. "We need to fight the problem at its root."

Unlike in 1979, that won't mean sending Russian troops to Afghanistan. But Moscow is working to provide something almost as potent: crucial intelligence on drug traffic throughout Central Asia, where Russia's Federal Security Service still maintains an excellent network of eyes and ears. Russia is also pushing Afghanistan's neighbors hard to pick up the pace on drug-enforcement efforts. Moscow, along with Beijing, leads the Shanghai Cooperation Organization (SCO), a regional security bloc that includes all Central Asian states. Beefing up border security has been one of SCO's top priorities, with Russia contributing money, equipment, and training. The SCO won't be able to cut off the Taliban's drug routes via Iran and Pakistan. And Kabul will still have to tackle the problem of rampant corruption in its Interior Ministry and the police, who are responsible for more opium traffic than the Taliban. But Chris Chamber, a NATO spokesman, says that Russia's intelligence and regional influence will be crucial to the fight.

Still, Russia's ambitions in Afghanistan go far beyond the drug war, and include building a pro-Russian constituency among the country's elite, dominating Afghanistan's multibillion-dollar infrastructure-development industry, and exploiting its underground wealth. "It is not too late. We are determined to activate our business cooperation with Afghanistan. Russia is first of all interested in exploiting Afghan gas and mineral resources," says Avetisyan, the Russian ambassador.

To access these riches, Russia has been courting Afghan Vice President Karim Khalili—a leader of the country's persecuted Hazara community who Moscow hopes will act as Russia's chief lobbyist in Kabul. At a meeting with Khalili in March, Ivanov offered to aid Japanese efforts to restore the huge Buddha statues destroyed by the Taliban in 1999 in Banyan, Khalili's power base, and to develop tourism there, as well as to reconstruct a power station and a nearby tunnel that links north and south Afghanistan.

Russia also has a huge number of potential allies among Afghanistan's former communists, many of whom studied and lived in Russia in the 1980s. Some of these approximately 100,000 educated Afghans joined the mujahedin after the fall of Moscow's puppet Mohammad Najibullah in 1992 and are now powerful men in Afghan President Hamid Karzai's administration. Gen. Abdul Rashid Dostum, for example, a onetime officer in Najibullah's military, now rules a personal fiefdom in the north of the country and is an adviser to the chief of staff of the Afghan National Army.

Other communists who fled after Najibullah was toppled returned after the fall of the Taliban. Many found important jobs in the new resource-starved government, as they tended to be better trained and educated than the Islamist mujahedin. One former senior European diplomat in Kabul says that, though the communists were unwanted at first, they quickly became the building blocks of the Karzai regime. "Thank God at last we have some professionals, even if they were trained and educated in Moscow," the diplomat says. Statistics are hard to come by, but according to a top Afghan police officer and a former communist head of the Afghan Army, between 50 and 70 percent of all staff positions in the Ministries of Interior and Defense are now held by ex-communists. Russia plans to reach out to these people by sponsoring cultural programs in Kabul and by bringing in some of the 100,000 Afghan exiles living in Russia to help lobby them.

Russians in Kabul are eager to take advantage of such links—one Russian diplomat complained that he's fed up with watching foreigners line up "to get a bite of the Afghan pie when it could have been us." To help turn things around, 19 Russian business leaders will arrive in the capital in early May to talk about energy, rebuilding, transport, and logistics.

The Russians say their aim is simply to help make Afghanistan rich. "The Soviets did not just fight. Soviet scientists also made maps of all Afghanistan's resources," says Avetisyan. On his recent trip, Ivanov brought such maps with him and, during a meeting with Karzai, talked about gas, copper, and aluminum exploitation. Ivanov also made it clear to Khalili that Russia was ready to strike deals on "favorable terms." The Russians will face an uphill battle with the Chinese, who got into the country ahead of them—two years ago, the China Metallurgical Group bought one of the world's largest copper mines in Logar, south of Kabul, and it has promised to invest $3 billion in the project. But Moscow is reported to be eyeing the Hajigak iron mine, currently on sale for about $1.8 billion, and Russians say they may be ready to sign a deal during a Russian-Afghan forum in Kabul this July.

So far, such moves seem to elicit more relief than concern in Washington. The Obama administration has taken a big gamble with its surge, and everything is being done with an eye to July 2011, when the administration has promised to begin its withdrawal. For that to happen, Afghanistan's neighbors must shoulder more and more of the burden of helping fix its drug and infrastructure problems. If that means Afghanistan moving closer to Russia's orbit, then Washington, at least for now, seems to deem that a price worth paying. "The United States is not concerned about Russia coming back," says Anthony Cordesman, a respected analyst at the Center for Strategic and International Studies. If history is any guide, having Afghanistan in Russia's sphere of influence would be far from ideal—but it would also be preferable to having it go it alone and spread violent mayhem across the region and the world.

With Ron Moreau and Sami Yousafzai in Kabul