PARIS — On the eve of the most consequential French presidential election in decades, the staff of the centrist candidate Emmanuel Macron said late Friday that the campaign had been targeted by a “massive and coordinated” hacking operation, one with the potential to destabilize the nation’s democracy before voters go to the polls on Sunday.

The digital attack, which involved a dump of campaign documents including emails and accounting records, emerged hours before a legal prohibition on campaign communications went into effect. While the leak may be of little consequence, the timing makes it extremely difficult for Mr. Macron to mitigate any damaging fallout before the runoff election, in which he faces the far-right candidate Marine Le Pen, who has pledged to pull France out of the euro and hold a referendum to leave the European Union.

The hacking immediately evoked comparisons to last year’s presidential election in the United States, during which American intelligence agencies have concluded that Russia’s president, Vladimir V. Putin, ordered an “influence campaign” to benefit the Republican nominee, Donald J. Trump.

Groups linked to Russia, that are also believed to have been involved in the hacking related to the 2016 United States presidential campaign, have previously been accused of trying to breach the Macron organization. Security experts tracking the activity of suspected Russian hackers say they believe those same groups were involved in this latest attack.