PARIS -- The French presidential election campaign of unprecedented twists and turns is saving its biggest surprise for last.

With French voters in a rebellious mood and many hesitant to the end about their choices, the identities of the two candidates who will progress to a winner-takes-all May 7 runoff remains anyone’s guess heading into Sunday’s first-round ballot.

With 11 contenders - from far-left to far-right - for the 47 million registered voters to choose from, the election is a high-stakes test for the European Union and for populist leaders who would tear it down.

Like Donald Trump in the United States, anti-establishment French populists Marine Le Pen and Jean-Luc Melenchon hope for an electoral electro-shock by surfing to power on voter disgust with politics as usual. Failure by both to qualify for round two would signal a receding of the populist wave which crashed over the EU with Britain’s “Brexit” vote last year to quit the bloc.

Get Breaking News Delivered to Your Inbox

The months-long French campaign seemed to grow ever weirder and more uncertain as polling day approached. A jobs-for-the-family financial scandal that punctured the Mr. Clean image and campaign of one-time front-runner Francois Fillon fueled the raging distrust between voters and their elected representatives. The siren call of Le Pen’s “France first” nationalist rhetoric, and Melenchon’s late surge, left Europe’s second-largest country and third-biggest economy at a crossroads, with its future in the EU up for grabs.

The implosion of the ruling Socialist Party, with outgoing President Francois Hollande too unpopular to run again, and the stunning success of his former economy minister, Emmanuel Macron, with an upstart middle-way grassroots campaign without major party backing, threatened to dismantle postwar France’s traditional left-right political divide.

French presidential election candidate for the En Marche! movement, Emmanuel Macron, reacts on stage at the end of a campaign meeting in Nantes, April 19, 2017. Getty

The threat of Islamic extremism after two years of attacks that killed more than 230 people, and with police thwarting what the government said was another planned attack this week, meant the vote was being held under heightened security, with more than 50,000 police and soldiers mobilized for Sunday and a state of emergency in place since 2015.

With the race too close to call, hesitant voters agonized whether to follow their hearts or their heads in the first round, meaning either backing their candidate of choice or casting a strategic vote aimed at keeping out candidates they didn’t want to have to choose between on May 7.

“It’s complicated,” real estate agent Felix Lenglin said during his lunch-time break in a Paris park. “We have to vote to stop the extremes but among the moderates, it’s a really difficult choice.”

The nightmare scenario for global financial markets: A second-round duel between the equally sharp-tongued Le Pen and Melenchon. Victory for either could, in the wake of the Brexit vote, possibly deliver a knockout punch to the EU ambition of ever-closer union among the peoples of Europe because both want to tear up agreements that bind together the 28 EU states.

French presidential election candidate for the far-left coalition La France insoumise Jean-Luc Melenchon (C) visits “Trivolution,” a workshop dedicated to industrial recycling in Lons-le-Saunier, eastern France, April 19, 2017. Getty

Melenchon says “the Europe of our dreams is dead.” He proposes “disobeying treaties from the moment we take power” and negotiating new EU rules -- followed by a referendum on whether France should leave the bloc it helped found. “We either change the EU or quit it,” Melenchon’s manifesto says.

The “totalitarian” EU has also long been one of Le Pen’s pet hates and constant target for her virulent nationalist discourse. She wants an in-out referendum on France’s EU membership, a new French franc to replace the common euro currency, and re-imposing French borders to staunch what she describes as out-of-control immigration. Like her father, National Front founder Jean-Marie Le Pen, in 2002, she hopes for an electoral coup by making the runoff. But pollsters suggest that, like him, she would likely lose on May 7 to any of the other top three opponents.

Or, alternatively, voters could step back from the brink of such radical change and opt for the more moderate hands of Fillon, a conservative former prime minister, and Macron, an electorally untested former investment banker unknown to voters before his two-year stint as Hollande’s business-friendly economy minister.

Their resilience has been among the election’s many surprises: Fillon because his campaign seemed mortally wounded by revelations that his wife and children benefited from cushy, and allegedly illegal, publicly funded jobs, and Macron because his campaign caught fire despite hostility from the left-right political establishment.

Macron’s relative lack of government experience made some voters hesitant about putting him in charge of France’s nuclear arsenal, its permanent seat at the U.N. Security Council, its fight against Islamic extremism and its role as a key player in international crises.

“The presidential costume is a bit big for him,” said Paul Rousselier, a Paris banker who plans to vote for the 39-year-old anyway. “There’s North Korea, Turkey, the thwarted (terror) attack - all things that could tip the vote.”

The ambitions of Fillon and Macron have come at a broader political cost. Fillon’s refusal to quit the race, as he’d previously said he would, in March when investigators pushed ahead with their probe into his family’s jobs as parliamentary aides further discredited the political elite in the eyes of many voters.

By quitting Hollande’s government to run as an independent, Macron also sucked away voters from the Socialist Party’s candidate, Benoit Hamon. Hamon’s near-irrelevance in the election’s closing stages, with his poll numbers in freefall, presented Socialist electors with the dilemma of whether to “vote utile” - cast a useful vote for a candidate likely to make the second round - or waste it on Hamon’s apparently doomed campaign.

“I’ll be a bit like everyone and follow the opinion polls,” said would-be Hamon voter Guillaume Deslandes, who was considering switching to Macron. “I’ll hesitate to the end.”

Voting stations open at 8 a.m. Sunday, with partial official results and polling projections of the outcome expected some 12 hours later.