The men were arrested in the southern city of Marseille by agents from France's domestic intelligence agency, AFP reported.
Interior Minister Matthias Fekl said the attack was to be carried out in the "next few days" by the two men, aged 23 and 29, who are known to be "radicalized".
More than 230 people have been killed in terror attacks in France since January 2015.
Candidates have been heavily guarded during the election campaign, but so far there have been few security scares.
"Everything will be done to ensure security" for the election, Fekl said.
The race was narrowing ahead of Sunday's vote, with the pack closing behind frontrunners Emmanuel Macron and Marine Le Pen, while a quarter of voters remained undecided.
For weeks, centrist former banker Macron and National Front (FN) leader Le Pen have been out in front but opinion polls now show there is a very real chance that any of the four leading candidates could reach the second-round runoff on May 7.
Scandal-plagued conservative Francois Fillon and far-left firebrand Jean-Luc Melenchon have closed the gap substantially in the last two weeks.
"We have never seen a four-way contest like this in the first round of a presidential election," Frederic Dabi of the Ifop polling institute told AFP.
Macron and Le Pen are tied on 22-23 percent, with Fillon improving to around 21 percent and Melenchon surging as high as 20 percent in some polls.
With Le Pen expected to reach the second round, polls continue to indicate that whoever faces her will win, although after Brexit and Donald Trump's US election win, no one is taking anything for granted.
Melenchon has made the most remarkable breakthrough in recent weeks, surging as high as 20 percent in some polls with a far-left program that involves huge public spending and a pledge to re-negotiate all European Union treaties.
Le Pen wants to pull France out of the eurozone and also foresees a mass renegotiation of EU treaties, sparking fears in Brussels that a victory for the far-right coming hot on the heels of Brexit could be fatal for the European bloc.
In contrast to Le Pen, Macron on Sunday told 20,000 people in Paris that France's future lay firmly in Europe, albeit one that suited French interests.
In a reference to Le Pen, Macron said voters had the choice of "hope and courage over resignation".
Polls also show that more than a quarter of voters has yet to decide who they will support on Sunday.
Analysts say there is a growing danger of a high abstention rate affecting the result, possibly tipping the scales in favor of Fillon.
Fillon, a 63-year-old former prime minister, has been charged over allegations he gave his wife Penelope a fictional job as his parliamentary assistant for which she earned nearly 680,000 euros ($725,000) in public money.
Fillon said Sunday he was confident he would upend the polls and reach the second round.