France's electoral commission has ordered media not to publish contents of Emmanuel Macron's leaked campaign emails to avoid influencing the election.

It warned news outlets in France that journalists could face criminal charges for publishing or republishing the material, under laws that came into effect at midnight forbidding any commentary liable to affect the presidential race.

There were fears the hack could swing Sunday’s final vote, where Mr Macron was expected to comfortably beat far-right candidate Marine Le Pen.

Le Pen v Macron: The debate in 60 seconds

As much as 9GB gigabytes of data were posted on a profile called EMLEAKS to an anonymous document sharing site under two days before the final vote.

While French election rules forbid the media from publishing the emails, they also ban Mr Macron or his team from commenting on or denying any allegations.

His En Marche! party said it had “been the victim of a massive and coordinated hack” on Friday evening, adding that it had “given rise to the diffusion on social media of various internal information”.

A spokesperson said the communications only showed the normal functioning of a presidential campaign, but that authentic documents had been mixed on social media with fake ones to sow “doubt and misinformation”.

“This operation is obviously an attempt at destabilising democracy, as has already been seen in the US during the last presidential campaign,” he added.

“The ambition of the authors of this leak is obviously to harm the En Marche! movement within hours of the second round of the French presidential election.”

French Presidential Election Show all 20 1 /20 French Presidential Election French Presidential Election Voters line up to cast their ballots REUTERS French Presidential Election French expats queue along the street outside the Lycee Francais Charles de Gaulle to cast their vote in a polling station inside the school, in the first round of the 2017 French presidential election, in London, Britain April 23, 2017. REUTERS/Luke MacGregor - RTS13JM5 REUTERS French Presidential Election People line up to vote in the first round of 2017 French presidential election at a polling station in Vaulx-en-Velin near Lyon, France, April 23, 2017. REUTERS/Emmanuel Foudrot - RTS13HSP REUTERS French Presidential Election Police patrol polling stations in France REUTERS French Presidential Election Francois Fillon (L), member of the Republicans political party and 2017 French presidential election candidate of the French centre-right, casts his vote in the first round of 2017 French presidential election in Paris, France, April 23, 2017. REUTERS/Christophe Archambault/Pool - RTS13IH0 REUTERS French Presidential Election Benoit Hamon (C), French Socialist party 2017 presidential candidate, is surrounded by photographers as he leaves a polling station after voting in the first round of 2017 French presidential election in Trappes, near Paris, France, April 23, 2017. REUTERS/Vincent Kessler - RTS13I0Y REUTERS French Presidential Election French President Francois Hollande collects voting slips before casting his ballot in the first round of the 2017 French presidential election at a polling station in Tulle, France, on April 23, 2017. REUTERS/Georges Gobet/Pool - RTS13ITO REUTERS French Presidential Election A policeman walks by election posters near a polling station during the first round of 2017 French presidential election in Paris, France, April 23, 2017. REUTERS/Christian Hartmann - RTS13I3A REUTERS French Presidential Election Emmanuel Macron and wife Brigitte Trogneux REUTERS French Presidential Election Emmanuel Macron casts his ballot REUTERS French Presidential Election Emmanuel Macron, head of the political movement En Marche !, or Onwards !, and candidate for the 2017 French presidential election, waves hand during in the first round of 2017 French presidential election at a polling station in Le Touquet, northern France, April 23, 2017. REUTERS/Benoit Tessier - RTS13ICH SAA/ French Presidential Election Jean-Luc Melenchon, candidate of the French far-left Parti de Gauche and candidate for the French 2017 presidential election, leaves a polling booth in the first round of 2017 French presidential election at a polling station in Paris, France, April 23, 2017. REUTERS/Stephane Mahe - RTS13IKB REUTERS French Presidential Election Front National leader Marine Le Pen casts her ballot Marine Le Pen (L), French National Front (FN) political party leader and candidate for French 2017 presidential election, casts her ballot in the first round of 2017 French presidential election at a polling station in Henin-Beaumont, northern France, April 23, 2017. At R, Mayor of Henin-Beaumont Steeve Briois. REUTERS/Charles Platiau - RTS13IEI REUTERS French Presidential Election Early ballots are read as results continue to come in Reuters French Presidential Election Macron supporters react as results come in early in the evening AP French Presidential Election Supporters of Front National leader Marine Le Pen cheer as early results come in Reuters French Presidential Election Alamy Live News. J21KYW Paris, France. 23rd April 2017. Marcon supporters wave French and EU flags after the announcement that he is the leader in the exit polls after the polling stations have been closed. Supporters of Emmanuel Macron, the Presidential candidate from the social liberal political party En Marche! celebrate the exit polls, that see him in first place, ahead of Marine Le Pen from the Front National in the first round of the French Presidential election. Credit: Michael Debets/Alamy Live News This is an Alamy Live News image and may not be part of your current Alamy deal . If you are unsure, please contact our sales team to check. Alamy French Presidential Election Front National leader Marine Le Pen takes to the stage to address her supporters as fans cheer Reuters French Presidential Election Emmanuel Macron greets supporters on Sunday night AP French Presidential Election Emmanuel Macron and wife Brigitte Trogneux celebrate the incoming results EPA

En Marche! previously complained about attempts to hack its emails, blaming Russian interests in part for the cyber attacks despite denials from the Kremlin.

Officials said it had been the target of failed attempts to steal email credentials dating back to January, identifying a hacking group operating in Ukraine.

Vitali Kremez, director of research with US-based cyber intelligence firm Flashpoint, told Reuters APT 28, a group tied to Russia’s military intelligence directorate, was behind the leak.

The collective, also known as “Fancy Bear” and “Sofacy”, has been linked to cyber attacks on the Democratic National Committee during the US election, the White House, German Parliament, Nato and French media.

Last month, APT 28 hackers registered decoy internet addresses to mimic the name of En Marche!, which were used to send corrupted emails to hack into the campaign’s computers, Mr Kremez said.

“If indeed driven by Moscow, this leak appears to be a significant escalation over the previous Russian operations aimed at the US presidential election, expanding the approach and scope of effort from simple espionage efforts towards more direct attempts to sway the outcome,” he added.

Far-right American activists are believed to be behind early efforts to spread the documents on social media, before they were picked up by Ms Le Pen’s supporters in France.

The leaks emerged on 4chan, where an anonymous poster provided links to documents on Pastebin with the message: “This was passed on to me today so now I am giving it to you, the people.”

The hashtag #MacronLeaks was spread by prominent Twitter accounts including that of Jack Posobiec, a pro-Donald Trump activist and employee of the far-right site Rebel TV.

The cyber attack came after repeated allegations of Russian interference in elections across Europe and the US, with Mr Macron previously targeting state media including Russia Today and Sputnik for spreading “fake news” to damage his campaign.

The two government-owned news outlets has announced legal action against Mr Macron over his allegations, which came after the politician denied unsubstantiated reports of an alleged offshore bank account.

Margarita Simonyan, the editor of both RT and Sputnik, said: “We are tired of their lies. We will sue them.”

The Paris’ prosecutor’s office said no one was named in the complaint, which has triggered an inquiry into the suspected spread of false stories aimed at influencing the election.

Vladimir Putin has dismissed allegations of interfering in foreign elections including the US and Germany, hitting out at unproven "rumours".

“We never interfere in other countries’ politics and we want no one to meddle in ours,” the Russian President said during a tense press conference with Angela Merkel.

“Unfortunately, we have seen the opposite happening for years. We have seen attempts to influence political processes in Russia through the so-called NGOs and directly.