PARIS (AP) — French President Emmanuel Macron appeared to comfortably win reelection Sunday in a runoff, polling agencies projected, offering France and the European Union the reassurance of leadership stability in the bloc's only nuclear-armed power as the continent grapples with the fallout from Russia's invasion of Ukraine.

A second five-year term for Macron — if confirmed by official results later Sunday — would spare France and its allies in Europe and beyond the seismic upheaval of a wartime shift of power to Macron's far-right nationalist challenger Marine Le Pen, who quickly acknowledged her defeat.

Her campaign had pledged to dilute French ties with the 27-nation EU, the NATO military alliance and Germany, moves that would have shaken Europe’s security architecture as the continent deals with its worst conflict since World War II. Le Pen also spoke out against sanctions on Russian energy supplies and faced scrutiny during the campaign over her previous friendliness with the Kremlin.

Polling agencies’ projections, released as the last voting stations closed, said Macron was on course to beat Le Pen by a double-digit margin. Five years ago, Macron won a sweeping victory over Le Pen to become France’s youngest president at 39. The margin is expected to be much smaller this time: Polling agencies Opinionway, Harris and Ifop projected that the 44-year-old pro-European centrist would win at least 57% of the vote.

Le Pen was projected to win between 41.5% and 43% support -- a still unprecedented result for the 53-year-old on her third attempt to win the French presidency.

Le Pen called her results “a shining victory,” saying that “in this defeat, I can't help but feel a form of hope.”

She and hard-left leader Jean-Luc Melenchon, who placed third in the first round of voting on April 10 and was among 10 presidential candidates eliminated that day, both quickly pitched forward to France's legislative election in June, urging voters to give them a parliamentary majority to hamstring Macron.

Early official results are expected later Sunday night.

If the projections hold, Macron would become only the third president since the 1958 founding of modern France to win twice at the ballot box, and the first in 20 years, since incumbent Jacques Chirac trounced Le Pen’s father in 2002.

Le Pen’s score this time rewarded her year-long efforts to make her far-right politics more palatable to voters. Campaigning hard on cost-of-living issues, she made deep inroads among blue-collar voters, in disaffected rural communities and former industrial centers.

Breaking through the threshold of 40% or more of the vote is unprecedented for the French far-right. Le Pen was beaten 66% to 34% by Macron in 2017. And her father got less than 20% against Chirac.

Several hundred Macon supporters gathered in front of the Eiffel Tower, singing the national anthem and waving French and European flags as television stations broadcast the initial projections of his win.

Still. the projected drop in support for Macron compared to five years ago points to what is expected to be a tough battle for the president to rally people behind him in his second term.

Many French voters found the 2022 rematch less compelling than in 2017, when Macron was an unknown factor, having never previously held elected office.

Leftist voters — unable to identify with either the centrist president or Le Pen’s fiercely nationalist platform — often agonized with the choices Sunday. Some trooped reluctantly to polling stations solely to stop Le Pen, casting joyless votes for Macron.

“It was the least worst choice,” said Stephanie David, a transport logistics worker who backed a communist candidate in round one.

It was an impossible choice for retiree Jean-Pierre Roux. Having also voted communist in round one, he dropped an empty envelope into the ballot box on Sunday, repelled both by Le Pen’s politics and what he saw as Macron’s arrogance.

“I am not against his ideas but I cannot stand the person,” Roux said.

Marian Arbre, voting in Paris, cast his ballot for Macron “to avoid a government that finds itself with fascists, racists.”

“There’s a real risk,” the 29-year-old fretted.

Macron went into the vote with a sizeable lead in polls but unable to be sure of victory from a fractured, anxious and tired electorate. The war in Ukraine and the COVID-19 pandemic battered Macron’s first term, as did months of violent protests against his economic policies. The upheavals created fertile ground for Le Pen.

With the EU’s only seat on the U.N. Security Council and only nuclear arsenal, the outcome in France was being watched across the 27-nation bloc as it grapples with the fallout of the war in Ukraine.

France has played a leading role in international efforts to punish Russia with sanctions and is supplying weapons systems to Ukraine.

Earlier in the day, Le Pen voted in the northern town of Henin-Beaumont, in France’s struggling former industrial heartland, while Macron voted in the resort town of Le Touquet on the English Channel.

Appealing to working-class voters struggling with surging prices, Le Pen has vowed that bringing down the cost of living would be her priority if elected. She argued that Macron’s presidency left the country deeply divided, pointing to the yellow vest protest movement that rocked his government before the COVID-19 pandemic.

Macron sought to appeal to voters of immigrant heritage and religious minorities, especially because of Le Pen’s proposed policies targeting Muslims and putting French citizens first in line for jobs and benefits.

Macron also touted his environmental and climate accomplishments to trawl for young voters who backed left-wing candidates in round one. Macron said his next prime minister would be put in charge of environmental planning as France seeks to become carbon neutral by 2050.

___

Associated Press journalists Thomas Adamson, Sylvie Corbet and Elaine Ganley in Paris, Michel Spingler in Henin-Beaumont, and Alex Turnbull in Le Touquet, contributed.

___

Follow AP’s coverage of the French election at https://apnews.com/hub/french-election-2022

Copyright 2022 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.