(Sarah Parnass/The Washington Post)

In this era of fiery populism and muscular anti-
globalist forces, politicians across Europe are suddenly discovering an electoral surprise.

It might actually pay to embrace the European Union.

The top finisher in the first round of the French presidential election on Sunday is Emmanuel Macron, a 39-year-old centrist who jets to Berlin to give speeches in English. The blue-and-yellow banner of the E.U. flutters off his campaign headquarters. He is strongly favored to beat his anti-Europe rival, Marine Le Pen, in a May 7 runoff.

After years in which the E.U. was the favorite foil for ascendant politicians on the continent, the 28-nation club may be making a comeback despite Brexit and President Trump’s euroskepticism. The Netherlands’ staunchly pro-European Green Left party quadrupled its support in elections last month. Former European Parliament president Martin Schulz is surging in polls ahead of September elections in Germany.

And Macron has promised, if elected, to help lead “an ambitious Europe,” restoring France to a preeminent place in the E.U. after years in which the French role has been diminished by its domestic struggles with unemployment, terrorism and political dysfunction. He has pledged to push for reforms that would force stronger nations to protect weaker ones.

Sunday’s balloting showed French attitudes toward Europe split down the middle, with euroskeptic politicians winning nearly half the vote. In addition to Le Pen, Jean-Luc Mélenchon, a far-left candidate, drew millions of votes. Opinion polls examining E.U. attitudes revealed conflicted feelings, with a majority of French respondents describing themselves as pro-E.U. but saying the institution needed deep reforms. 

Given such division, European leaders nervously watched the first-round voting to see which way France might tilt. On Monday, many political figures were unusually public about their support for Macron.

German Chancellor Angela Merkel’s chief of staff, Peter Altmaier, tweeted that Macron’s first-place finish showed that “France AND Europe can win together. The center is stronger than the populists think!”

The centrist German lawmaker Alexander Lambsdorff heaped on more praise. Macron is “a French John F. Kennedy,” he told Germany’s ZDF television Monday.

In a rare display of cross-continental comity, Macron also was congratulated by Greek Prime Minister Alexis Tsipras, a combative leftist who has sparred with the German government ever since he was forced to accept a humiliating bailout in 2015.

Pro-E.U. politicians were not the only ones to focus on Macron’s attitudes toward Europe.

Nigel Farage, the British ­anti-E.U. politician who helped lead last year’s Brexit campaign, tweeted dismissively that Macron gave his victory speech Sunday night “with EU flag behind him. Says it all.”

Leaders in Europe normally maintain a studious silence when the vote isn’t on their turf. That they didn’t in this case reflects the gravity for Europe of the final round of the French vote.

If Macron is elected — and opinion polls suggest he has a comfortable lead over Le Pen despite his first-round squeaker — continental leaders are cautiously optimistic that he can steer the beleaguered country back to its historically central role in European affairs. If Le Pen wins, modern Europe — defined by integration and growing cooperation across national boundaries — could fall apart after already being jolted by Britain’s decision to exit the E.U.

Analysts believe that if Macron can put more of a Gallic stamp on the E.U. machinery in Brussels, he may have a chance to shift France’s complicated attitude toward the bloc back toward more positive ground, particularly if he can also jump-start his country’s stalled economy.

“The French liked Europe when it was a greater France, but they feel today that it’s no longer the case. It’s a greater Germany,” said Eddy Fougier, an expert on anti-globalization movements at the French Institute for International and Strategic Affairs.

For all their concerns about the E.U., voters may be becoming more wary of disruptive European politicians as they watch Trump churn up political turmoil in the United States and Britain solidify its E.U. divorce plans.

Dutch euroskeptic leader Geert Wilders crashed out of front-runner status ahead of March elections in the Netherlands. Germany’s euroskeptic Alternative for Germany party spiked after Trump’s election but has more recently split and sputtered. Now the ascendant political force in Germany is Schulz, a center-left leader who spent more than two decades as a member of the European Parliament and has staked his career on a robust defense of Brussels.

And though Italy’s anti-establishment Five Star party is doing well before elections that must be called before the spring of 2018, few observers see it as the existential threat to Europe that a Le Pen presidency would be.

The support for the centrist politicians reflects “a reasonable approach to a reality that everybody must recognize, and that is the European Union,” said Daniel Cohn-Bendit, a Franco-German former European lawmaker who supports Macron. 

“Today more and more people are concerned about how we can protect Europe and the European project,” Cohn-Bendit said. “This has a link with Trump’s election, with Brexit.”

At a time when the E.U.’s popularity is on the wane, Macron has stood apart for his unabashed support for Europe and globalization. On a January trip to Berlin’s Humboldt University, he switched to flawless English to exhort students to build a stronger Europe. The move drew praise in Germany — and darts from his far-right rivals, who said he was disrespecting the French language.

As the European powers-that-be closed ranks around Macron on Monday, they took two major risks. One is that by backing the French centrist, they will fan the flames of anti-establishment ire that have propelled Le Pen’s rise. 

“It could reinforce some of the discontent in France among those who will see this as the global elite denying them their right to vote,” said Josef Janning, head of the Berlin office of the European Council on Foreign Relations. 

The other potential pitfall is that European leaders could find it more difficult to work with Le Pen if she wins. For months before Americans voted last year, European leaders denounced Trump — only to have to make amends this year with solicitous visits to the new U.S. president at the White House.

“It would have been dumb to speak out in the way they did if they thought she could still win,” Janning said. “They seem to view that possibility as close to zero.” 

Analysts suggested that, even if Macron wins, Europe’s centrists will need to keep their expectations in check for what he can achieve.  “It may be that Europe’s leaders have an over-interpretation of the role Macron can play,” said Claire Demesmay, who studies France for the German Council on Foreign Relations. “The anti­European mood in France will still be there — and it could increase.”

Birnbaum reported from Paris. Virgile Demoustier in Paris, Stephanie Kirchner in Berlin and Karla Adam in London contributed to this report.