Hungary's Prime Minister Victor Orban's ruling Fidesz party was defeated in Budapest mayoral elections.
CNN  — 

When Hungary’s Prime Minister Viktor Orban congratulated his “Polish friends” on their electoral victory on Sunday, it was at roughly the same time as his own party was suffering a major defeat at home.

The Central European allies – both populist strongholds that have clashed with the European Commission and rights groups over perceived crackdowns on democracy in recent years – were on Monday grappling with different electoral outcomes.

Poland’s ruling nationalist Law and Justice Party (PiS) now looks set to hold onto its parliamentary majority following the highest voter turnout since the end of communism in 1989. On Monday, with a little over 80% of districts counted, the party had won 45.16% of votes.

This means the country will remain at loggerheads with the European Commission over its judicial reforms – which Brussels says breach the EU’s core values, and PiS argues are necessary for court efficiency.

Meanwhile in Hungary, voters delivered a major blow to Orban’s ruling Fidesz party in the Budapest mayoral election. Opposition challenger Gergely Karacsony was on track to be named new Budapest mayor, winning 50.6% of the votes over Fidesz-backed incumbent Istvan Tarlos, with just over 80% counted Monday.

Orban’s national grip on power remains unchanged, and his party did have wins in local elections outside the capital. But the result sharpens the divide between the capital and rural areas, where Fidesz support is huge, and offers a taster of what could lie ahead in a general election slated for 2022.

Poland’s PiS celebrates…

Poland’s PiS will have four more years in power on the back of an election campaign that experts say shifted to the left on the economy – promising increased social spending on things like parental and retirement benefits.

But it also shifted to the right culturally – taking aim at LGBTQ groups, and promoting a nationalist Catholic image.

The party put out “really quite nasty anti-LGBT propaganda delivered through their subservient public media,” said Stanley Bill, senior lecturer in Polish Studies at the University of Cambridge.

Bill added that the hardline message was aimed more at mobilizing PiS’ “ultra-conservative base” rather than at “Polish society as a whole.”

Despite his party’s success, PiS leader Jaroslaw Kaczynski appeared “oddly subdued” during his victory celebration, said Bill.

That’s because his party secured only a “slim majority” – not the kind of super-majority that would give it the power to change the constitution, he said.

Unlike the power wielded by his ally in Hungary.

While Hungary’s Fidesz suffers setback

While both Hungary and Poland are ruled by nationalist parties, there are key differences. “Orban’s majority is much larger and therefore he’s been able to take control of the state on a much greater level than PiS,” said Bill.

Hungary has come under fire from the European Commission and rights groups for its increasingly autocratic self-styled “illiberal state.” Much like Poland, it has taken a hardline on migrants and promoted a Christian, nationalist image.

While Orban’s Fidesz party remains popular in the countryside, the capital, Budapest, now appears to have booted out Tarlos, who had been mayor since 2010.

His successor, pro-European Karacsony, was backed by cross-party opposition rather than a single party. It’s a strategy they’ll be refining ahead of the 2022 general election, said Robert Laszlo, election expert at Budapest think tank Political Capital.

A former researcher at a public polling institute, Karacsony has the image of “an outsider, a quiet, smiley guy,” said Laszlo – a far cry from the bullish persona of Orban, who has won consecutive general elections since 2010.

Ahead of the election, Karacsony drew parallels between Budapest’s mayoral race and Istanbul’s vote earlier this year. He told the Financial Times he even made trips to meet Istanbul’s new mayor, Ekrem Imamoglu, whose win was a major blow to Turkish President Recep Tayyip Erdogan’s party.

That said, “Hungary is not Turkey,” said Laszlo, pointing to many differences in the countries’ freedom of the press, international military importance, and level of autocracy.

He said many Hungarian opinion leaders and even opposition politicians believe Orban is “unbeatable.” But Istanbul showed that “even in this kind of authoritarian regime, the media and leader can be defeated.”

The challenge for Hungarian opposition parties will be translating their local success to a national level. If Poland is any indication, they’ll have their work cut out for them.

CNNs Stephanie Halasz and Martin Goillandeau contributed to this report.