French far-right presidential candidate Marine Le Pen has been egged during a campaign stop just three days before Sunday's election.

Le Pen, who is competing against centrist Emmanuel Macron, was quickly hurried indoors by her team.

A lawyer by training, she is the leader of the National Front whose vision for France diametrically opposes that of Macron's.

She wants France to follow Britain and leave the European Union - via a referendum.

The 48-year-old's election campaign majored on jobs, security and the threat from Islamic extremism.

In a fiery television debate on Wednesday evening, Macron warned there will be "civil war" if his far-right opponent Marine Le Pen is elected.

Le Pen painted the former banker and economy minister as a servant of big business and finance, and declared herself "the candidate of the people, of the France that we love."

Macron countered that Le Pen's anti-terror plans would play into the hands of the extremists and divide France.

Former US President Barack Obama has endorsed Macron with polling day just days away.

In a video message released on the centrist's twitter page, he said: "I have admired the campaign that Emmanuel Macron has run.

"He has stood up for liberal values. He put forward a vision for the important role that France plays in Europe and around the world. And he is committed to a better future for the French people.

"He appeals to people's hopes and not their fears.