Hungary’s prime minister, Viktor Orban, was the first European Union leader to endorse Donald Trump for president of the United States. “I listened to [Trump], and I have to tell you that he made three proposals to stop terrorism. And as a European, I myself could not have drawn up better what Europe needs,” he said in late July. His praise of Trump should come as no surprise. While Orban was once a key figure in Hungary’s transition from communism to liberal democracy, since then he has proved more than willing to use populism, cynicism, and nationalism to cement his grip on power. Orban has dominated the Hungarian political scene for 27 years, ever since the country freed itself from the grip of the Soviet Union in 1989. But the man has never been short on ambition: Having decided that this domestic success was not enough, he has now set his sights the European Union. Even as the troubled union struggles to figure out its post-Brexit future, Orban has stepped into the spotlight, questioning the continent’s deepening integration and offering an alternative to the “politically correct” liberal democracies of Western Europe. In February, he scheduled a referendum, set to take place on Oct. 2, on whether Hungary should accept the EU’s plan to resettle a small number of refugees there. The wording of the question leaves no doubt as to the answer Orban expects from his people. In this strategy, analysts see a ploy to wield the authority of “democracy” — distorted though his version may be — as a cudgel against Brussels. But Orban won’t stop with refugees. He has grander ideas about what’s ailing Europe. The continent’s elites, he preaches — echoing Trump — are unable to address the people’s concerns, and have therefore lost their legitimacy. It’s time for more radical change — and he’s the man to bring it.

Viktor Orban speaks during the ceremonial reburial of former Hungarian Prime Minister Imre Nagy on June 16, 1989. (ISTVAN CSABA TOTH for AP Photo/MTI)

It was in the summer of 1989, at a ceremony honoring the martyrs of their 1956 uprising against the Soviets, that Hungarians first took note of the fiery, then-goateed Orban. At the time, the prospects of the anti-communist reform movements across central Europe were uncertain, and the swift and largely peaceful fall of the USSR was not yet a given. So when Orban used the occasion of the ceremony to call for the withdrawal of Soviet troops from Hungary — at a time when the subject was still taboo — many Hungarians admired his boldness. Orban appeared to be a rebel with a liberal cause, fighting to turn Hungary into a multiparty democracy rooted in human rights and political freedoms.

Orban never stopped speaking his mind since, especially when it has meant confronting the status quo to score a political win. While it’s hard to see his anti-Soviet stance as anything other than admirable, in hindsight it looks more like a preview of his core political instinct for radicalism. The ferocity he once deployed against the Soviet empire is now deployed — and with no less enthusiasm — against domestic political opposition, vulnerable migrants, and Brussels technocrats.

Naming Turkey and Russia as models, Orban has declared that he wants to build an “illiberal democracy” in Hungary. And like the leaders of those countries, Orban is vocal and unabashed about his religion. He is a Protestant, was married in a church, and has made no secret of his belief that Christianity forms a vital part of Europe’s cultural identity. “Europe should recognize,” he said in 2012, “that without nations it has no heart, and without Christianity it has no soul.”

So what happened to the young, liberal Orban? The popular narrative of his political coming of age is a tale right out of Star Wars.An idealistic young leader destined to save the galaxy from evil forces becomes frustrated with the slow consensus-building mechanisms of democracy and turns to the dark side himself — twisted, like Darth Vader, into a copy of what he once opposed. In this telling, Orban is a liberal so frustrated by liberalism that he has turned against it.

But those who know him best — on both sides of the political spectrum — say this is a misreading of Orban’s character. His supporters insist that Orban has remained himself, only more so. After all, it’s only natural for an anti-establishment rebel to evolve into an anti-establishment leader. Meanwhile, Orban’s critics say that he has always harbored anti-liberal sentiments. For them, his resistance to the Soviets was principled, but also opportunistic — he caught the anti-communist wave at exactly the right moment. In this view, Orban’s recent authoritarian turn and his adroit exploitation of the anti-elite sentiment now on the rise in Europe is only further proof that he is Hungary’s most skilled politician.

Viktor Orban addresses a press conference at the delegation hall of the parliament building in Budapest on Feb. 24. (ATTILA KISBENEDEK/AFP/Getty Images)

Orban comes from a background he himself described as being “without culture,” with no real connection either to the peasant countryside nor to the urban intelligentsia. Growing up in two small villages, Orban frequently fought with his authoritarian father, whom he once described as “violent.”

He left his football career for law school and moved to Budapest, the country’s capital and its only big city. Hard-working and motivated, he found the urban intelligentsia aloof, distant, and out of touch — the first signs of an anti-elitist sentiment that he has since turned into a political platform. “Viktor moved around in the world of culture a bit like a bull in a china shop,” wrote Gabor Fodor, Orban’s college classmate, who quit his Fidesz party in 1993.“I think Viktor [was] really bothered by the fact that he came from the countryside,” Fodor added. “This bad attitude was amplified and later grew into an ideology.”

Meanwhile, the grip of the Soviet Union was loosening. In 1988, with a core group of college friends, Orban founded the Alliance of Young Democrats (Fidesz), a radical anti-Communist movement with an anti-establishment streak. The party called for a parliamentary democracy and a market economy, but also championed a liberal message of inclusion. Notably, at the time, Fidesz also saw Hungary as a natural part of Europe. Orban has been the party’s unquestioned leader since its founding, and it’s partly a testament to his determination, his shrewdness, and his unscrupulousness that what started out as a liberal student organization has since become Hungary’s nationalist ruling party.

Those who know him describe Orban as curious and smart, a fast learner who can quickly detect shifts in political and social moods. He asks pointed questions and stores information like a sponge. But he is also cold, rational, and calculating. According to his peers, his radicalism and political self-awareness made him stand out in Fidesz, which — at least at the beginning — was made up mostly of idealists.

“He has always wanted to upset the status quo, to become a change-maker,” says Zsuzsanna Szelenyi, an opposition legislator who joined Fidesz in its early days but left after Orban took a conservative turn in 1993. “That has not changed in him,” she adds.

In those early Fidesz days, the movement’s decisions were made by friendly consensus in the college dorm rooms where its founders lived. But this period didn’t last. In Hungary’s first free elections in 1990, the party won just enough seats to become the fifth-largest in parliament. Along with the parliamentary seats came money and power — and now that the party had access to resources, Orban began to take control of the distribution of perks and opportunities. Szelenyi remembers her college mate having no scruples about making the most of his position as the party’s leader. When selecting his team, he made sure to reward loyalty over honesty and expertise, favoring those who did not challenge his decisions.

Tamas Deutsch, a member of the European Parliament also from Fidesz, who has known Orban from his university years, argues that Orban was not suppressing criticism, merely that he was good at “finding the right place for the right people.” But Szelenyi insists that “collective decision-making ceased to exist once the parliamentary political group was born under Orban’s leadership.”

After the next election in 1994, Fidesz’s larger liberal sister party signed a coalition deal with the socialists, crossing what for Fidesz was a red line. The once-close parties drifted further apart. By this time, Hungary’s main conservative party, the Hungarian Democratic Forum, was a shambles, and Orban seized the opportunity to steer Fidesz towards the gap on the right of the Hungarian political arena. Some core members like Szelenyi and Fodor had grown fed up and left the party, but Orban’s hard-line tactic worked: While Fidesz won 7 percent of the vote in 1994, in the 1998 elections it had over 29 percent, control of the government, and the premiership. At the age of 35, Orban was the most powerful man in the country.

Viktor Orban and Russian President Vladimir Putin attend a joint press conference after their meeting outside Moscow on Feb. 17. MAXIM SHIPENKOV/AFP/Getty Images.

The party had a successful tenure in power. In the wake of the previous government’s tough austerity measures, the Fidesz government provided young families with benefits such as housing support, reduced debt, and a steadily growing economy, all while curbing inflation. But despite this solid economic performance, the 2002 elections were a tough battle. Numerous corruption scandals, Fidesz’s obvious attempts to centralize power, and the Socialists’ promises of economic benefits cost Orban votes.

During the final weeks of the campaign, Orban did not shy away from deeply divisive moves. To name one example, he called on his voters to wear the Hungarian tricolor cockade, exploiting a national symbol to send the message that patriotic Hungarians vote Fidesz. But it was not enough: Though Fidesz remained the largest party in parliament, it was the Socialists who managed to put together a coalition government, driving Fidesz into the opposition. As Deutsch remembers,Orban took the defeat personally, feeling “deeply hurt emotionally” after his four successful years.

Some analysts argue that the 2002 defeat turned Orban cynical, convincing him that good economic performance alone would not deliver the votes — and that he would need to use other measures to return to power.

Orban clearly had no intentions of giving up. He rebuilt Fidesz by establishing what he called “civic circles,” small cells of right-wing voters who formed a movement of like-minded Christian conservatives. He still lost in 2006 to Ferenc Gyurcsany, an energetic Socialist candidate — but victory was not far off.

Shortly after the election, the Socialist prime minister was caught on tape admitting that he had lied about the state of the economy in order to win. His failure to resign immediately despite the public outrage prompted riots in Budapest. He and his party tried to hold on, but their popularity plummeted, and Orban’s Fidesz did not need to do much to sweep into power four years later.

This time the Fidesz voter base delivered. “If we hadn’t lost in 2002, we would have not won a two-thirds majority in the parliament in 2010 and in 2014,” says Deutsch.

The one-time footballer had become a chess master. Orban’s supporters praise him for staying at the helm of Fidesz despite the ups and downs, while his critics contend that he has sidelined those who challenged him, played rivals against each other, and tested the loyalty of his lieutenants. Perhaps as a result, he’s never had a real challenger for the leadership of the party.