French President Emmanuel Macron has won re-election, convincingly defeating his rival Marine Le Pen.

President Macron was set to win around 58% of the vote in the second-round run-off compared with Ms Le Pen on 42%, according to projections by polling firms for French television channels based on a sample of the vote count.

Mr Macron is the first French president to win a second term for two decades, but Ms Le Pen's result also marks the closest the far-right has ever come to taking power in France and has revealed a deeply divided nation.

The 44-year-old president faces a litany of challenges in his second term, starting with parliamentary elections in June, where keeping a majority will be critical to ensuring he can realise his ambitions to reform France.

The outcome was expected to be confirmed by official results overnight with the final figures due on Monday.

In a victory speech on the Champ de Mars in central Paris at the foot of the Eiffel Tower, Mr Macron vowed to respond to the anger of voters who backed his far-right rival, saying his new term would not continue unchanged from the last five years.

Marine Le Pen embraces her mother Pierrette in Paris following the exit poll projections

"An answer must be found to the anger and disagreements that led many of our compatriots to vote for the extreme right. It will be my responsibility and that of those around me," he told thousands of cheering supporters.

He also pledged a "renewed method" to govern France, adding that this "new era" would not be one of "continuity with the last term which is now ending".

In a combative speech to supporters in Paris in which she accepted the result but showed no sign of quitting politics, Ms Le Pen, 53, said she would "never abandon" the French and was already preparing for the June legislative elections.

"The result represents a brilliant victory," she said to cheers.

"This evening, we launch the great battle for the legislative elections," Ms Le Pen said, adding that she felt "hope" and calling on opponents of the president to join with her National Rally (RN) party.

The result is narrower than the second-round clash in 2017, when the same two candidates met in the run-off and Mr Macron polled over 66% of the vote.

For Ms Le Pen, her third defeat in presidential polls will be a bitter pill to swallow after she ploughed years of effort into making herself electable and distancing her party from the legacy of its founder, her father Jean-Marie Le Pen.

Critics insisted her party never stopped being extreme-right and racist while Mr Macron repeatedly pointed to her plan to ban the wearing of the Muslim headscarf in public if elected.

Emmanuel Macron casts his vote in Le Touquet

French presidential election: What you need to know

Taoiseach Micheál Martin and a host of other European leaders have congratulated Mr Macron following the vote.

The Taoiseach said Mr Macron's "principled and dynamic leadership" was important "not only for France, but for Europe".

Victory for the centrist, pro-European Union Macron was immediately hailed by allies as a reprieve for mainstream politics that have been rocked in recent years by Britain's exit from the European Union, the 2016 election of Donald Trump and the rise of a new generation of nationalist leaders.

"Bravo Emmanuel," European Council President Charles Michel, wrote on Twitter. "In this turbulent period, we need a solid Europe and a France totally committed to a more sovereign and more strategic European Union."

The projections caused immense relief in Europe after fears a Ms Le Pen presidency would leave the continent rudderless following Brexit and the departure from politics of German chancellor Angela Merkel.

But he will have to win over those who backed his opponents and the millions of French who did not bother to vote.

On the basis of the official figures, polling organisations estimated that the abstention rate was on course for 28%, which would be the highest in any presidential election second-round run-off since 1969.

High on his to-do-list is pension reform, including a raising of the French retirement age which Mr Macron has argued is essential for the budget but is likely to run into strong opposition and protests.

The hard-left third-placed candidate in the first round, Jean-Luc Melenchon, had refused to endorse Mr Macron and now has his eyes firmly set on the July elections.

Mr Melenchon welcomed Le Pen's defeat as "very good news for the unity of our people".

Nevertheless, "Mrs Le Pen and Mr Macron have barely a third of the registered voters," he said.