Soviet Army soldiers ride armored personnel carriers after their unit crossed a bridge on the border between Afghanistan and then-Soviet Uzbekistan near the Uzbek town of Termez on Feb. 15, 1989. (Alexander Zemlianichenko/AP)

On Feb. 15, 1989, a column of armored personnel carriers rolled across the Friendship Bridge, the last of a Soviet army that fought a 10-year war in Afghanistan. After losing more than 13,000 troops in the quagmire, the Soviet Union pulled back, defeated and demoralized. Later that year, the Congress of People’s Deputies, the first semi-democratically elected representative body of the U.S.S.R., passed a resolution that condemned the war.

While the military was unhappy with criticism from lawmakers and the press, criticizing the decision to go to war in Afghanistan has generally not been controversial in Russian politics. On the contrary, a consensus has developed over decades that the war was a costly mistake. Now, however, the Russian government is considering reversing this earlier verdict, with the Duma set to approve a resolution officially reevaluating the intervention as one that took place within the bounds of international law and in the interests of the U.S.S.R.

It is a stunning reversal, one that calls attention to how, as Russia’s ambitions change, so, too, does the story it tells about its past. The Kremlin is rewriting history to retrospectively justify intervention in countries such as Ukraine and Syria as it seeks to regain its status as a global power.

When Soviet leaders decided in December 1979 to invade Afghanistan, they did not expect the war to drag on for a decade. The intervention aimed to replace Hafizullah Amin, whom the Soviets suspected of pro-U.S. leanings, with a more pliable leader. Before long, however, the Soviet army found itself fighting a counterinsurgency against a loose alliance of the mujahideen backed by Pakistan, Saudi Arabia, the United States and China.

But the Soviet allies in Kabul had little legitimacy and had a hard time mustering a reliable army. The Soviets easily outmatched their foe in conventional combat but could not hold territory: Every time the Soviet troops withdrew, the mujahideen would come back. By the early 1980s, it was clear to everyone, including the Soviet proponents of the intervention, that the war was unwinnable. Mikhail Gorbachev made it a priority to leave Afghanistan after he became the general secretary in March 1985.

The problem wasn’t so much the costs of the war. Although expensive (the fighting cost Moscow about $7.5 billion between 1984 and 1987 alone), Afghanistan was still just a drop in the bucket, compared with the overall Soviet military budget (roughly $128 billion). The problem was Moscow’s reputation. “What, are we going to sit there forever?” Gorbachev fumed at the Politburo in November 1986. “Or should we be ending this war? Otherwise, we’ll disgrace ourselves in every respect. . . . We have to get out of there now. We have to get out of there!”

It took time. Gorbachev was worried about Moscow’s credibility as a superpower patron. By the 1980s, the Soviet Union had many states dependent on Moscow’s support to a greater or lesser degree. Would the leaders of these states still see Moscow as a reliable ally? Or would they seek patronage from Moscow’s chief rivals: Washington and Beijing? “India is worried. They are worried in Africa,” he argued at the Politburo. “They think it will be a blow against the authority of the Soviet Union in the national liberation movement. And they say: If you run away from Afghanistan, imperialism will go on the offensive.”

Yet unlike his predecessors, Gorbachev increasingly realized that Moscow’s Third World allies — the self-proclaimed Marxist-Leninists and petty dictators — were the wrong crowd to mingle with, that the real greatness was elsewhere: in the superpower summits in Geneva; Reykjavik, Iceland; and Washington, and in working with President Ronald Reagan to solve global problems, including the problems of the Third World.

Improvement of Soviet-American relations in the late 1980s allowed Gorbachev to shelve concerns about credibility and quit Afghanistan. With the suddenly liberated Soviet press writing critically about the intervention for the first time, the war entered history as a costly, terrible mistake, an interpretation that was generally accepted by the Russian public. Gorbachev, for all his domestic unpopularity, was given due credit for ending a pointless war. The decision to go to war was attributed to a sclerotic and narrow-minded leadership under the aging Leonid Brezhnev, general secretary until his death in 1982. The intervention was just the most tragic example of the “stagnation” that Gorbachev had said characterized those years.

Two things have changed in recent years. The first is how Russia looks at the Soviet past. For a long time the official position, espoused by Russian President Vladimir Putin and others, was to criticize the excesses of the Soviet past while legitimating the strong state and powerful security forces created under socialism. Putin might have called the collapse of the U.S.S.R. a geopolitical catastrophe, but he also supported the opening of the gulag museum in Moscow and other projects that wrestled with the bloody sides of Soviet history. Increasingly, however, the government has turned to a more unabashedly positive assessment of the Soviet era, including Joseph Stalin’s crimes. In the Kremlin’s reading of history, the glory of being a superpower somehow compensated for the Soviet regime’s brutalities.

The second is Russia’s foreign policy and particularly its willingness to use force abroad. After the breakup of the U.S.S.R., Russia had largely avoided military commitments beyond its own borders. (The two wars with Chechnya were seen as a fight against separatism). That has changed with Moscow’s (indirect) involvement in Ukraine and especially its intervention in Syria.

Putin may have intervened in Syria because of genuine security concerns, a legacy of friendship with the regime of President Bashar al-Assad or a desire to project Russia’s great-power status to the detriment of the United States. Regardless, Moscow finds itself in an open-ended and costly commitment. To avoid domestic opposition, it cannot allow the public to perceive Syria through the prism of the Afghan experience. Putin and his allies have decided to tackle this problem head-on by reinterpreting that experience.

Putin, at one point, seemed eager to continue Gorbachev’s rapprochement with the West, but those days are long gone. The most important lesson of the Gorbachev era, for today’s leaders, is that criticism of the past brings few political benefits and comes fraught with danger. Rather, it is much better to create a past that is usable. That is why perhaps Putin, and Russian lawmakers, are marking the poignant anniversary of the Soviet withdrawal from Afghanistan by attempting to ascribe meaning to that long-lost meaningless war.