Back in 2010, Boris Gromov, the general who oversaw the withdrawal of Soviet troops from Afghanistan, and Dmitry Rogozin, Russia’s ambassador to NATO, published an editorial in theNew York Times, saying that a premature NATO pullout “would give a tremendous boost to Islamic militants, destabilize the Central Asian republics and set off flows of refugees, including many thousands to Europe and Russia.”

Moscow’s decision to work with the Taliban is a form of insurance for the future. Sooner or later, Russian officials seem to think, the Taliban are going to be part of a some kind of ruling coalition or the outright masters of Kabul. If so, it helps to be on good terms with them now.

There is precedent for Moscow’s action. Back in the fall of 1991, with the Soviet Union on its last legs, Russian President Yeltsin invited a delegation from the opposition, led by Burhanuddin Rabbani, to Moscow. The USSR had tried for ten years to help the communist regime in Kabul subdue a coalition of rebel groups.

Although the Kabul government retained control of the cities, the countryside was mostly in opposition hands. The war was openly criticized in the press from the summer of 1989. The USSR still existed, but after the August coup its days were numbered. Yeltsin, not Soviet president Mikhail Gorbachev, was the top political figure. When Rabbani came to Russia, Yeltsin promised that support for the Kabul regime would soon end, and sought cooperation with the future rulers of Afghanistan.

Rabbani’s tenure in Kabul did not last long, as his group and other mujahedeen fell into civil war. But Yeltsin’s outreach proved helpful in the long run. After Tajikistan erupted in civil war in 1992, Rabbani’s forces offered shelter to Tajiks allied with the opposition. In subsequent years, Moscow’s links with Rabbani’s party to help negotiate an end to the civil war. And by 1998, Rabbani was turning to Russia for arms.

In establishing a relationship with the Taliban now, Russian officials no doubt think they are practicing a form of political realism. They may be right. Yet Moscow’s re-entry into Afghan politics also underscores the horrific damage that foreign intervention – chiefly, but not exclusively, American and Russian/Soviet – have done to the country.