October three decades ago the fall of the Berlin Wall was still in the future. But ongoing events in Hungary made possible, and perhaps inevitable, the final collapse of communism.

Indeed, October was a bad month for those who sought to enslave the Hungarian people. They were the dubious “beneficiaries” of liberation by the Red Army as World War II rushed to a close. The Soviet occupiers then made the mistake of holding free elections, won by the Independent Smallholders Party. Moscow regrouped, slowly but surely ensuring the communist party’s monopoly of power. The Hungarian People’s Republic was founded in 1949.

Alas, all was not good in paradise. The Mátyás Rákosi government was brutally repressive. Joseph Stalin’s death in March 1953 led to domestic liberalization and bitter struggle within the Hungarian communist party. Rákosi was ousted as party chief in July 1956. Three months later students reestablished a previously banned democratic student organization; demonstrations broke out on October 23.

The regime requested Soviet military intervention “to suppress a demonstration that was reaching an ever greater and unprecedented scale.” Protests and violence spread, reformer Imre Nagy was restored to the premiership, Hungarian military discipline dissolved, and communist party hardliners fled. The Soviets withdrew, and a new government was formed, which announced plans to treat the revolution as a “great, national, and democratic event,” establish a “social democracy,” dismantle the secret police, withdraw from the Warsaw Pact, and take a position as a neutral power.

Hungarians hoped they could choose their own path, and the Soviet politburo, led by Nikita Khrushchev, initially decided against intervening. But Moscow quickly reversed itself, leaving historians to argue over whether the revolutionaries’ declaration of neutrality was the trigger. On November 1, additional Soviet military units entered the country. Three days later, the Soviets launched “Operation Whirlwind” with 22 army divisions. Hungarians resisted heroically: individual army units as well as loosely organized resistance fighters battled hard. Opposition in Budapest was soon suppressed, but revolutionaries held out longer elsewhere, including in the industrial city of Dunaújváros.

The Hungarian Revolutionary Worker-Peasant Government, headed by János Kádár and backed by the Soviets, took control. Repression was brutal. Nagy and other revolutionary leaders were executed; tens of thousands of Hungarians were imprisoned or interned; hundreds of thousands of Hungarians fled across the temporarily open border. In succeeding years, Kádár’s “goulash communism,” highlighted by modest reforms through the New Economic Mechanism, yielded slightly better living standards but no political reform. By the 1980s, economic pressures undermined what little credibility Kádár retained, and he retired under pressure in 1988.

By 1989 the regime’s life was ebbing. Restrictions started to loosen. In April 1989, the regime turned off the electric border fences. On May 2, guards began tearing down the fences. In June, the Hungarian foreign minister joined his Austrian counterpart in a ceremonial fence-cutting. Not only were Hungarians free to travel to the West. So were the other inmates of the prison behind the long-standing Iron Curtain.

On August 19, Hungarians and Austrians held the Pan-European Picnic, or “friendship picnic,” on the border. Some 900 East Germans, heretofore allowed to travel freely within the Soviet bloc, took advantage of the opportunity and fled to Austria and ultimately on to West Germany. The following month, Hungary’s foreign minister announced that his government would not prevent East Germans from fleeing. As successive Eastern European regimes loosened controls, repressive rule became more difficult everywhere. On November 9, the Berlin Wall came down.

Nagy had been a reform communist thrust into a revolutionary role. He ended up the people’s hero. He was executed on June 16, 1958, and all markings on his grave were eliminated. But in 1989 a new set of reform communists, including Imre Pozsgay, pushed to reconsider the 1956 revolution. Once a hardliner, he broke with Kádár in the early 1980s. In January 1989, Pozsgay shocked his compatriots by calling the events of 1956 a “popular uprising.”

Before events spun out of control, hardliners plotted to declare martial law. Years later, Pozsgay admitted that he responded with bluff. He rightly assumed that the Soviet Union’s Mikhail Gorbachev would not use force to save the Hungarian People’s Republic. Moreover, the Hungarian added, “I was confident that the army and the security forces would not work with [communist party General Secretary Károly Grósz]. I told him that a Hungarian soldier ordered to shoot on his own people would either shoot his commander or go home to his mother. From that moment he backed down.”

Pozsgay attended the reburial of Nagy on the 1989 anniversary of the latter’s death. (Ironically, so did a then-liberal student leader by the name of Viktor Orbán, today the much more conservative, even considered authoritarian by some, prime minister of Hungary.) The ceremony drew some 200,000 onlookers; it was a dramatic moment that signaled that Iron Curtain was rusting away. Pozsgay and other reformers took control of the communist party and began discussions with opposition groups. He sponsored the border picnic that highlighted the new freedom for East Germans. In October, the communist party held its last congress, renaming itself the Hungarian Socialist Party.

About that time, the parliament made Hungary the second communist state, after Poland, to approve multi-party elections. On October 23, 1989, the Republic of Hungary was proclaimed. Soviet troops were withdrawn — fully and permanently — between March 1990 and June 1991. Pozsgay was the country’s most popular politician as the Hungarian People’s Republic faded away, but he was out-maneuvered and ultimately transcended in the new Hungary.

Yet he was not bitter. Two decades later, the BBC’s Bill Hanrahan tracked down the then-retired politician. Pozsgay had no second thoughts. He once was a true believer, he explained, “But from the early ’80s I realized it was unreformable — and the only thing to do was to change that system.” More than anyone else, he helped propel his nation and people away from the Soviet past. This accelerated the collapse of communist rule elsewhere in the Soviet Empire.

The succeeding three decades after the collapse of communism have been tougher than many hoped. A joke circulating in 1989 was that “We know you can turn an aquarium into fish soup, but an you turn fish soup back into an aquarium?” The meaning was simple yet profound: the commies had wrecked entire societies. How to restore them?

In some countries the process was expensive but not terribly painful. In others — Bulgaria, Romania, Ukraine, and especially Russia — making the leap from totalitarian communism to capitalism was extra tough. And even the best of governments struggled with tough issues: punishment of communist apparatchiks, restitution of confiscated property, privatization of state assets, integration into Europe, and more. These nations are still striving to overcome their Marxist, Leninist, and Stalinist nightmares.

At a time when ever more Americans rate “socialism” favorably, it is especially important to remember the horrors and failures of systems that so many people struggled so long to overthrow. Many were oppressed, imprisoned, and even murdered for their efforts. Finally, three decades ago came the long-overdue end of supposed socialist utopias across Central and Eastern Europe. Hungarians deserve a special thank you for accelerating the death of communism.

Doug Bandow is a Senior Fellow at the Cato Institute and former Special Assistant to President Ronald Reagan. He is the author of Foreign Follies: America’s New Global Empire.