BUDAPEST, Hungary – He stacked the judiciary with cronies. He took over the universities. He shut down independent news outlets. He gerrymandered the voting districts to ensure his continued rule, all in the name of saving the country and its heritage from liberal outsiders — and in the process became a model for an aspiring autocrat 4,500 miles to the west.

Three months ago, against the odds and in overwhelming fashion, Hungarians somehow showed Viktor Orbán the door anyway.

Sixteen years after having returned to power with a vow never to lose it again, Europe’s most autocracy-curious, Russia-friendly leader was so convincingly thrashed at the polls that he could not even try to claim fraud and reject the results, as many had feared.

“Nobody’s phone was working because of the people gathering together, and just music was everywhere,” said Imola Varga, an 18-year-old college student and part of the wave of young Hungarians who turned out in droves to vote against Orbán, as she recalled election night. “It was just such a euphoric moment. Everybody was just hugging everybody around them.”

As surprising as Orbán’s election loss was, the aftermath has been perhaps even more astonishing. The man who defeated him, a former member of Orbán’s own Fidesz party who broke away following a sexual abuse pardoning scandal, has wasted no time pushing through legislation and constitutional amendments undoing what Orbán had wrought.

Péter Magyar was sworn in as prime minister a little under a month after the April 12 election. In the two months that have followed, he has begun restoring the independence of institutions Orbán had coopted, removed Hungary’s block of European Union military aid to Ukraine, accepted anti-corruption standards to unlock frozen EU grants and loans to Hungary and revived a four-country alliance of former Soviet-bloc nations to counter Russian influence.

Magyar’s victory and his quick actions to reorient Hungary back in the direction of western Europe brought a sigh of relief to both EU and NATO leaders who in recent years had with increasing heartburn watched Orbán tilt the nation ever more toward Russian dictator Vladimir Putin.

And for democracy advocates in Europe and America, Magyar’s resounding win has offered a shot of optimism following Donald Trump’s post-coup-attempt return to the White House and his subsequent moves that appear to have used Orbán’s tactics as an instruction manual.

“So many bright red flags are dismissed until something really awful happens,” said Amanda Carpenter, a former Republican Senate aide and now a researcher for the nonprofit Protect Democracy. “Magyar’s willingness to speak directly to the rampant corruption and tackle it head-on in office is inspirational.”

Indeed, scholars of autocracy and Hungarian politics believe that just as Trump and his allies have been using Orbán’s descent into an “illiberal state” modeled after Russia and China as a playbook, so can democracy activists use his defeat in Hungary as a guide to surviving the Trump era in the United States.

“Democratic decline is not necessarily irreversible. If citizens remain engaged, even when politics becomes frustrating, there is always a path back,” said Johan Norberg, a Cato Institute researcher who has written extensively about Orbán’s Hungary.

Even more useful to those seeking to unwind Trump’s attacks on democratic institutions and norms in the United States is his rampant personal corruption — the very issue many Hungarians cite as the reason they threw out Orbán.

“Péter Magyar connected corruption to the misery of ordinary people,” said Zsolt Enyedi, a political science professor at Central European University, as he described Magyar’s framing of the election. “It was also a choice between democracy and dictatorship. A choice between rule of law and oppression, a choice between the west and Moscow. At the moment, a majority of Hungarians believe that oppressive authoritarian rule also makes you poorer.”

In the picturesque city straddling the Danube River where Orbán had ruled for 16 years, the joy released by his departure was a long time coming.

Cities, and especially capital cities and those that host universities, are usually the centers of liberal thought and politics, while social conservatism dominates rural regions. Hungary was no exception.

“The citizens of Budapest are in the hands of those people who are living in settlements of less than 5,000 people,” said Balint Magyar, unrelated to the prime minister but the former education minister in the last non-Orbán government from the early 2000s.

(Magyar means “Hungarian” in Hungarian and is a common surname in the country.)

Orbán had originally been elected prime minister as leader of the conservative Fidesz party in 1998 but then left office after just a single term in 2002. It was after that loss that he vowed that if ever he regained power, he would make sure never to lose it again.

Sure enough, after returning as head of state in 2010, Orbán set to work, dismantling the institutions of a pluralistic democracy step-by-step to give himself near autocratic control over both the government and Hungarian society itself. Thanks to a two-thirds majority in parliament, secured by his landslide win over a weak and divided opposition, Orbán forced the retirement of judges and chose their replacements.

He imposed advertising taxes on the news media, driving many to bankruptcy and making it easy for his allies to buy them up, while also making it clear that publishing articles critical of him would result in advertising boycotts by both the government and Orbán’s friends in private business. His government pulled broadcast licenses for outlets that aired stories critical of his rule.

Orbán also co-opted the higher education system, a focal point for opposition to his moves toward autocracy. He put universities under the control of boards whose members he had appointed. With Central European University, founded by Hungarian billionaire and boogeyman for the global right George Soros, Orbán went even further, denying the school the right to operate in Hungary at all.

For Enyedi, who was 50 years old at the time, it meant having to commute to work in neighboring Austria, as CEU set up an academic campus in Vienna while turning its newly renovated building located just blocks from Hungary’s iconic parliament house into administrative and outreach offices.

“It was difficult. Even now, I spend much of my life on the train between the two cities. My German is not so good,” he said, adding that it was even worse for some of his fellow faculty members and staff who had young children. “I know it was traumatic for a lot of my colleagues.”

Orbán’s most insidious move to retain power, though, was a straight-ahead attack on the country’s election regime itself. He and his allies in parliament pushed through “reforms” that reduced the number of districts while drawing the lines to provide disproportionate representation to Orbán’s voting base in rural areas. Some of the districts varied from the mathematical ideal by as much as 20% — a variance that violated European Commission rules.

This extreme — and, even by U.S. standards, illegal — gerrymandering allowed Orbán to maintain supermajority control of parliament even while he and his party did not have broad support. In 2014 and 2018, Orbán was able to hold two-thirds of the seats despite not even winning a majority of the popular vote.

Balint Magyar said he saw signs of Orbán’s push toward autocracy as far back as his first term.

“I knew, given Orbán’s character, that he would do this,” Magyar said. “I knew already between 1998 and 2002, that if he gets back in power, this is what will happen.”

If Orbán’s actions to consolidate his power in Hungary seem vaguely familiar to Americans, they should. His anti-democratic “accomplishments” have served as a how-to guide for Donald Trump and his aides and allies.

Orbán attacked the independent media. Trump has made suing news outlets who anger him with their coverage a cottage industry. Orbán used the power of the state to issue and withhold broadcast licenses based on whether they pleased or angered him. Trump’s Federal Communications Commission openly talks about doing the same.

Orbán took over Hungary’s higher education system; upon taking office, Trump immediately began suing universities in an attempt to control their missions and curricula. Orbán tried to buy the support of key constituencies with tax breaks and subsidies, and so has Trump, with targeted tax cuts for the elderly and those with tip and overtime income, subsidies to farmers and bonuses for military service members.

And just as Orbán redrew the legislative district maps with the intent of making himself impossible to dislodge, so Trump demanded that Republican-led states redraw their congressional maps to ensure that Democrats would not regain control of Congress in the coming midterms.

“Trump is trying to do in four years what took Orbán 16,” said H. David Baer, a professor at Texas Lutheran University who has lived in and written about Hungary.

Trump himself has not been shy about his admiration for the would-be autocrat, endorsing him repeatedly in his re-elections and claiming, falsely, that Orbán is “highly respected” in Europe. Ahead of the April election, Trump sent Vice President JD Vance to campaign for Orbán and just two days before the election even promised the country of 10 million people “the full Economic Might of the United States” in aid — if they re-elected his friend.

(Trump’s White House did not respond to HuffPost queries for this article.)

Oleksandr Shtokvych, the outreach director at CEU’s building in Budapest, which until Orbán’s decree had housed student classrooms, said that after seeing discussions of the Trump-allied Heritage Foundation’s Project 2025 during the last American presidential campaign, he grew curious about its origins and decided to look into it himself.

“As I kept reading, I was like, ‘it’s not a plan, it’s a description of what others did already,’” he said in a recent interview from a conference room overlooking Budapest’s riverfront skyline. “It’s a description of what Putin did. It’s a description of what Orbán did. Because they tried, they tested all these things. And they basically said, yeah, it can work. This is how it can work.”

As Orbán steadily and openly dismantled democratic institutions through the years, though, the general reaction among the Hungarian public was muted, at best.

In a student union cafeteria some weeks after the election, Imola Varga recalled going to protests in Budapest as a child of college professors. And then, come election time, it would not matter. Orbán would win yet again.

“The Democratic coalitions against him were so weak that it was, it felt like we were powerless in a way,” she said.

Sandor Esik, a lawyer and anti-Orbán activist for years, said the lack of a significant groundswell against Orbán in response to his attacks on democracy was not surprising. Most voters do not think of such abstractions.

“The only thing they want is some kind of stability and very low taxes, to put it very simply,” he said.

To hold together enough votes, in fact, Orbán essentially began purchasing them with targeted tax breaks and subsidies for specific blocs. Retirees received bigger pensions. Parents of young children got payments, as did police, soldiers and secret service agents.

In an attempt to limit losses among young voters, Orbán even eliminated income taxes for those younger than 25.

“He did some great things,” said Dorka Szerbci, a 22-year-old university student and beneficiary of that particular tax break, even as she acknowledged that other taxpayers, like her parents, had to pick up the slack. “For me it’s good, but for them it’s not good.”

Yet Orbán’s efforts to buy the electorate’s good graces began to falter not long after his last reelection in 2022. The flouting of European Union rules on issues ranging from immigration to academic freedom to voting standards led to the withholding of billions of euros in funding. Hungarians watched their living standards fall while Orbán’s friends and family continued to enjoy extravagant lifestyles.

Even in the capital city renowned for the magnificence of its neo-gothic parliament building on the banks of the Danube, just blocks away are neighborhoods that retain the look and feel of Hungary’s Soviet-bloc history, with harsh architecture showing its age from lack of upkeep. Roads and highways similarly display the signs of maintenance too long deferred. While much of Europe enjoys modern, high-speed rail, Hungary’s system is a running joke among residents.

The lack of public investment compared to peer countries like Poland, Slovakia and even Romania, in fact, created a flashpoint of resentment, particularly as wealthy friends of Orbán would show off their wealth with private jets.

Missing from the 922-page Project 2025 autocracy manual, as it turns out, is the singular feature of Orbán’s rule that in the end brought him down: his corruption. Not just ordinary, better-access-for-friends corruption, but shameless, over-the-top, ostentatious-to-the-point-of-absurdity corruption. The sort where the childhood friend of the prime minister goes from being a gas line fitter to a billionaire, the richest person in Hungary. The sort where Orbán’s family estate hosts a herd of, of all things, zebras.

“Imagine 300 Jared Kushners around Donald Trump,” said Esik, describing the scale of the cronyism and what appeared to be outright looting.

Political scientist Enyedi described how state assets were simply transferred to private individuals who all happened to be connected to Orbán.

“He treated the country as his fiefdom,” Enyedi said, but added that it did not give rise to popular discontent until Hungarians’ own personal circumstances began to suffer. “Many Hungarians would have tolerated the regime had the economy not faltered.”

The economy did falter, though, and in spectacular fashion. Hungary had some of the worst inflation after the coronavirus pandemic in all of Europe. Ordinary Hungarians felt their lives had gotten materially worse in recent years and began tying their own misery to the luxurious lives of Orbán’s ruling clique.

“Even if you’re not following the news, you can see they are together in something shady,” said Balogh Miklos, a 22-year-old clerk at a downtown Budapest convenience store. “I hear that from a lot of people that they thought he was stealing or his friends were stealing.”

“Corruption is getting harder and harder, and by the last 10 years they were not even trying to hide it anymore,” said Barnabás Rákász, who spends his afternoons and evenings wearing a captain’s hat trying to persuade tourists to buy a river cruise and the rest of the day building a hospice care business.

At 37, Rákász is the quintessential swing voter. He supported Orbán in 2010 and 2014 but voted against him in 2022 and this past April. The corruption that made him switch sides was when tobacco could no longer be sold in grocery and convenience stores and could only be purchased in government-licensed shops, which not long after also got the exclusive right to sell alcohol. “This was the first small step I recognized,” he said.

Rákász credited Orbán’s takeover of most media for the reason Hungarians in the rural areas — Orbán’s base — continued to support him for so long. “Somebody living in a smaller village, doing five days, eight-hour time, getting home, get a beer, and watching TV. He will see the news,” Rákász said. “All he sees of Orbán is that he’s the best. He’s doing everything good. He’s protecting us from the immigration, from this, from there.”

Eventually, though, even Orbán supporters thought the corruption had gone too far. “Before the people were not as mad as they were this year when the election was,” Dorka Szerbci said as she sat in a Budapest barbershop as her partner, a Trump-supporting Floridian, got a haircut. “It was just getting more and more, and it was because they were stealing.”

On top of the increasing discontent, Orbán also had the misfortune this election of facing someone not easily tarred as a liberal elite. Péter Magyar had been a member of Orbán’s Fidesz party until his ex-wife was forced from the government for refusing to go along in a pardon scandal involving a convicted pedophile.

Magyar made Orbán’s corruption his singular issue and took it beyond the cities where Orbán was already disliked, visiting hundreds of smaller towns and villages that had been Orbán’s strongholds. He even staged an 11-day, 200-mile walk from Budapest to the Romanian border town of Nagyvarad to demonstrate his interest in speaking to all Hungarians.

In response, Orbán was left attacking the European Union and warning that his loss would lead to involvement in Russia’s war against Ukraine. Posters and billboards featuring villainous-looking renditions of European Commission President Ursula von der Leyen and Ukrainian President Volodymyr Zelenskyy dotted the countryside.

“The success of Magyar was precisely that he was not talking about liberal values, he was not talking about LGBT, or he was not talking about, you know, Ukrainians,” said CEU’s Oleksandr Shtokvych. “He was focusing on corruption and the economic issues…. He really did the sort of door-to-door work. He brought his message to those who actually feel the economic hardship.”

On the night of April 12, Orbán’s 16 years in power came to an abrupt end. Early returns showed him losing even many of the rural counties where his support had been the strongest. The gerrymandering effort that had let him turn small margins into a stranglehold in parliament now worked against him. Magyar and his Tisza party won 55% of the popular vote but 71% of the seats, giving him the two-thirds supermajority to undo all of Orbán’s system rigging.

Rákász recalled the massive crowds at Magyar’s outdoor election night rally and, finally, Orbán’s phone call to Magyar.

“That was a very happy day. The people were so uplifted after the results came in,” he said. “At one point, Orbán was congratulating him, and then the whole square was jumping about it.”

For democracy advocates in Hungary and in the United States, both Magyar’s election victory and his new government’s rush to push through reforms carry lessons for those who hope not merely to stop Trump, but to undo his efforts to undermine and weaken democracy.

In Hungary, despite Orbán’s open attacks on democratic institutions and his closeness to the Russian dictator, most voters did not share experts’ worries that he was on the path to a Putin-style autocracy. Just so, in the United States, despite Trump’s violent coup attempt to remain in power after losing reelection, most Americans do not believe Trump is an existential threat to the republic, and trying to persuade them otherwise is wasted energy, experts said.

“Orbán has so many similarities with Trump in that their most brazen power grabs are in plain sight and don’t register as a danger to people because there is a tendency to think that authoritarians seize power with military might and violent crackdowns,” Protect Democracy’s Amanda Carpenter said. “That’s not true of the modern authoritarians who are democratically elected and then use these salami slice tactics to dismantle democratic institutions more gradually with targeted policy plans.”

At the same time, Trump’s unprecedented use of his office to enrich himself — the very definition of public corruption — gives democracy supporters the same fertile ground that Péter Magyar and his Tisza party were able to use in Hungary.

“I guess the difference between ordinary people and elites is quite similar across the world,” said the Hungarian political scientist Zsolt Enyedi. “The elites are more concerned about democracy, rule of law, checks and balances, et cetera, the people are more upset about corruption.”

He added that the talent of the opposing candidate also matters, as Magyar showed. “Mix Mamdani and Trump and a centrist viewpoint, then you got Peter Magyar,” he said.

Erica Franz, an authoritarianism scholar and professor at Michigan State University, said democracy in and of itself is too abstract for most voters to care about. The key to preserving it is to point out that despite its flaws, it is still better than the alternative.

“Most people really want their basic needs met. They don’t have a clear understanding of what democracy is,” she said. “In the short term, people who are doing OK can turn a blind eye to autocratic behaviors and justify them as fine. Eventually, however, democracy is better for people. Most autocrats are power hungry, they often turn to corruption to please their inner circle, and they ultimately pursue policies that benefit the few.”

The key, said Cato’s Norberg, is to connect Trump’s efforts to put billions into his pockets to the hardships the typical family is facing and spend less time talking about his efforts to erode democratic institutions.

“Pay attention to the concrete manifestations of that erosion: the favoritism, corruption and misuse of public resources. People are often more persuaded by stories of taxpayer-funded vanity projects, private zoos, and roundabouts to nowhere than by abstract warnings about democratic backsliding,” Norberg said. “Talking about such examples and linking them to institutional erosion seems like a winning formula. And, oh, refuse to get drawn into culture-war battles.”

Others advised learning from Péter Magyar’s decision to wrap himself in the flag — as Orbán had done since his 2010 run — and not allowing Trump to set the terms for what it means to be an American. Magyar made the national flag a feature of every rally, and Democrats and anti-Trump Republicans would be wise to do so, as well, said Sandor Esik.

“Magyar recaptured all the national symbols from Orbán, and he used them shamelessly,” he said.

He said he tells Americans at conferences that Trump is not all-powerful and advises them not to be so pessimistic.

“You could be Russian with that pessimism,” he joked, pointing out that the best source of material to oppose Trump is usually Trump himself. “If he keeps it up, he might turn Texas blue.”