NEW YORK -- One stood for freedom, openness, peace and closer ties with the outside world. The other is jailing critics, muzzling journalists, pushing his country deeper into isolation and waging Europe's bloodiest conflict since World War II.
Such are history's bookends between Mikhail Gorbachev, the Soviet Union's last leader, and Vladimir Putin, Russia's president.
In many ways, Gorbachev, who died Tuesday, unwittingly enabled Putin. The forces Gorbachev unleashed spun out of control, led to his downfall and the Soviet Union's collapse.
Since coming to power in 1999, Putin has been taking a hard line that resulted in a near-complete reversal of Gorbachev's reforms.
When Gorbachev came to power as Soviet leader in 1985, he was younger and more vibrant than his predecessors. He broke with the past by moving away from a police state, embracing freedom of the press, ending his country's war in Afghanistan and letting go of Eastern European countries that had been locked in Moscow's communist orbit. He ended the isolation that had gripped the USSR since its founding.
It was an exciting, hopeful time for Soviet citizens and the world. Gorbachev brought the promise of a brighter future.
He believed in integration with the West, multilateralism and globalism to solve the world's problems, including ending armed conflicts and reducing the danger of nuclear weapons.
In marked contrast, Putin's worldview holds that the West is an "empire of lies," and democracy is chaotic, uncontrolled and dangerous. While mostly refraining from direct criticism, Putin implies that Gorbachev sold out to the West.
Returning to a communist-style mindset, Putin believes the West is imperialistic and arrogant, trying to impose its liberal values and policies on Russia and using the country as a scapegoat for its own problems.
He accuses Western leaders of trying to restart the Cold War and restrain Russia's development. He seeks a world order with Russia on equal footing with the United States and other major powers, and in some respects is trying to rebuild an empire.
Gorbachev sometimes bowed to Western pressure. Two years after U.S. President Ronald Reagan implored him to "tear down this wall" in a speech at the Berlin Wall, Gorbachev did so, indirectly, by not intervening in populist anti-communist revolutions in Eastern Europe. The dropping of the Iron Curtain and end of the Cold War followed.
At home, Gorbachev introduced two sweeping and dramatic policies -- "glasnost" or openness -- and "perestroika," a restructuring of Soviet society. Previously taboo subjects could now be discussed, in literature, the news media and society in general. He undertook economic reforms to allow private enterprise, moving away from a state-run economy.
He also loosened up on the dreaded police state, freed political prisoners such as Andrei Sakharov, and ended the Communist Party's monopoly on political power. Freer foreign travel, emigration and religious observances were also part of the mix.
Putin has veered away from Gorbachev's changes. He focused on restoring order and rebuilding the police state. An increasingly severe crackdown on dissent has involved jailing critics, branding them traitors and extremists, including for merely calling the "special military operation" in Ukraine a war. He sees some critics as foreign-funded collaborators of Russia's enemies.
In his quest for control, he's shut down independent news organizations and banned human rights and humanitarian organizations. He demands complete loyalty to the state and emphasizes traditional Russian family, religious and nationalistic values.
Gorbachev's leadership was not without failures. His more liberal policies were uneven, such as a bloody 1991 Soviet crackdown on the independence movement in the Soviet Baltic republic of Lithuania and the attempted early coverup of the 1986 Chernobyl nuclear power plant disaster.
By 1988, he realized that trying to hide bad events wasn't working, so when a massive earthquake hit Armenia in December 1988, he opened the borders to emergency international help and allowed transparency about the destruction.
After nearly a decade of fighting in Afghanistan, Gorbachev ordered the withdrawal of Soviet troops in 1989, entered into multiple arms-control and disarmament agreements with the United States and other countries, and helped end the Cold War. For those efforts, he was awarded the Nobel Peace Prize in 1990.
But at home, Gorbachev's economic reforms didn't go well. Freeing industries from state control and allowing private enterprise too quickly and haphazardly created widespread shortages of food and consumer goods, worsened corruption and spawned a class of oligarchs.
The burgeoning independence movements in Soviet republics and other problems so angered Communist Party hard-liners that they attempted a coup against him in August 1991, further weakening his grip on power and leading to his resignation four months later.
In the end, many in Russia felt Gorbachev had left them with broken promises, dashed hopes and a weakened, humiliated country.
One who felt that way was Putin. For him, much of what Gorbachev did was a mistake. The biggest was the Soviet Union's collapse, what Putin called "the greatest geopolitical catastrophe of the century."
The Soviet Union was disrespected, defeated and broken into pieces -- 15 countries. For Putin, it was also personal, because as a KGB officer stationed in East Germany, he watched in horror as massive crowds staged the popular uprising that led to the removal of the Berlin Wall and Germany's reunification, at one point besieging his KGB office in Dresden.
To this day, Putin's perceptions about threats to his country and popular revolutions color his foreign policy and his deep mistrust of the West. They underpin his decision to invade Ukraine on Feb. 24.
As one justification for the war, he cites what he believes was a broken U.S. promise to Gorbachev -- a supposed 1990 pledge that NATO would not expand into Eastern Europe. U.S. officials have denied making such a pledge, but Putin believes NATO's expansion, and specifically the prospect of neighboring Ukraine joining the alliance, pose an existential threat to Russia.
Critics allege that Putin distorts the facts and ignores local sentiments to claim Ukrainians want to be liberated from the Kyiv government and align with Moscow.
He has embarked on a massive effort to modernize and expand Russia's military might, moving away from arms-control accords that Gorbachev agreed to.
Putin's war in Ukraine, alleged human rights violations and the 2014 annexation of Crimea have drawn massive international sanctions that are reversing the cultural and economic ties that Gorbachev fostered. But for a few allies, Russia is isolated.
While one might expect Gorbachev to have been more critical of Putin, he supported Russia's annexation of Crimea, condemned NATO's eastward expansion and said the West bungled the opportunities the Cold War's end offered.
But in many other ways, the historic bookends between the two leaders are set far apart.
One observer who sees Gorbachev's business as unfinished is Mikhail Khodorkovsky, a Russian tycoon who moved to London after spending a decade in a Russian prison on charges widely seen as political revenge for challenging Putin.
"Gorbachev gave freedom not only to Baltic and Eastern European states, he also gave freedom to the Russian nation," Khodorkovsky said after Gorbachev's passing. "It's a different matter that we haven't quite managed to make use of that freedom."
Andrew Katell was an Associated Press correspondent based in Moscow who covered Gorbachev from 1988 to 1991. Now semi-retired, he has maintained a lifelong interest in Russian affairs and is a contributor to the AP's coverage of Russia and Ukraine.