Soviet Union in less than two years. In an attempt to avoid a third short-lived leader, in 1985, the Soviets turned to the next generation and selected Mikhail Gorbachev. Gorbachev made significant changes in the economy and party leadership, called "perestroika". His policy of "glasnost" freed public access to information after decades of heavy government censorship. Gorbachev also moved to end the Cold War. In 1988, the Soviet Union abandoned its nine-year war in Afghanistan and began to withdraw its forces. In the late 1980s, , which paved the way for Revolutions of 1989. With the tearing down of the Berlin Wall
Mikhail Gorbachev the flag of the Soviet Union was lowered from the Kremlin and was replaced with the Russian tricolor flag. The next day, 26 December, the Soviet of the Republics, the upper chamber of the Supreme Soviet, declared that the Soviet Union had ceased to exist as a functioning state, and formally voted both itself and the Union out of existence. Two days after Gorbachev left office, on 27 December 1991, Yeltsin moved into Gorbachev's old office. Gorbachev had aimed to maintain the CPSU as a united party but move it in the direction of Scandinavian-style social democracy. But when the