CNN  — 

Six weeks ago, Hungary’s election campaign looked and sounded very different.

The stakes were already high. Viktor Orban, the longest-serving national leader in the European Union, was seeking to extend his authoritarian premiership deep into its second decade. His rival, leading a united front of opposition parties, bluntly denounced Orban’s crusade against independent institutions and the rule of law.

But the political focus was resolutely domestic. When foreign policy took center stage, it was usually raised by Orban to tout his international credentials – such as on February 1, when he boasted of his political longevity while in Moscow, a few feet from his staunch ally President Vladimir Putin.

Now, everything has changed. Putin’s invasion of Ukraine later that same month has upended the race, recasting its protagonists and rewriting their pitches. It has left Orban, widely regarded as the EU’s most pro-Kremlin leader, walking a political tightrope. And it has shone a spotlight on a years-long entanglement between him and the Russian President, two strongmen whose political journeys bear some notable similarities.

“If you want to analyze the election campaign, you have to draw a line on February 24,” said Andrea Virág, director of strategy at the Republikon Institute think tank in Budapest, Hungary’s capital. “Since the war started, it’s completely different.”

The race – which will culminate in Sunday’s election – is now portrayed by the opposition as a crossroads between Hungary’s eastern and western horizons. “We only have one choice: we must choose Europe instead of the east,” opposition candidate Péter Marki-Zay, the man carrying the hopes of every Orban critic, told supporters this month.

Marki-Zay leads a united coalition of every major opposition party – a last-gasp and fragile effort that symbolizes how dramatically anti-Orban parties have been sidelined in recent votes.

War on Hungary’s border has also added urgency to what was already a thorny relationship between its government and the EU. While Orban has supported most of Europe’s sanctions against Russia, back home the political pragmatist – who has maintained relationships with dictators and democrats for years – has focused his pitch on keeping Hungary out of the conflict, and has dodged numerous opportunities to disavow Putin even as the Russian leader wages war.

Now, Orban’s political future rests on the success of his most complicated shapeshift yet – into a self-declared peacekeeper who won’t quit Russia.

Orban met with Putin in Moscow just three weeks before Russia began its invasion.