By Sudip Kar-Gupta

PARIS (Reuters) - Emmanuel Macron was elected president of France on Sunday with a business-friendly vision of European integration, defeating Marine Le Pen, a far-right nationalist who threatened to take France out of the European Union, early projections showed.

The centrist's emphatic victory, which also smashed the dominance of France’s mainstream parties, will bring huge relief to European allies who had feared another populist upheaval to follow Britain's vote to quit the EU and Donald Trump's election as U.S. president.

The 39-year-old former investment banker, who served for two years as economy minister but has never previously held elected office, will now become France's youngest leader since Napoleon with a promise to transcend outdated left-right divisions.

Watch Today Show on Yahoo View, available now on iOS and Android.

Three projections, issued within minutes of polling stations closing at 8 p.m. (2 p.m. ET), showed Macron beating Le Pen by around 65 percent to 35 - a gap wider than the 20 or so percentage points that pre-election surveys had pointed to.

Even so, it was a record performance for the National Front, a party whose anti-immigrant policies until recently made it a pariah in French politics, and underlined the scale of the divisions that he must try to heal.

Le Pen's high-spending, anti-globalisation 'France-first' policies may have unnerved financial markets but they appealed to many poorer members of society against a background of high unemployment, social tensions and security concerns.

The 48-year-old's share of the vote was set to be almost twice that won by her father Jean-Marie, the last National Front candidate to qualify for a presidential runoff, who was trounced by Jacques Chirac in 2002.

Macron's immediate challenge will be to secure a majority in next month's parliamentary election for En Marche! (Onwards!), his political movement that is barely a year old, in order to implement his program.

However, at least one opinion poll published in the run-up to the second round has indicated that this could be within reach.

(Additional reporting by Ingrid Melander, Marina Depetris, Bate Felix and Sybille de la Hamaide; Writing by Richard Balmforth; Editing by Kevin Liffey)