The arrests "took place as part of an investigation by the anti-terrorist section of Paris public prosecutor's office, Fekl said. The men, born in 1993 and 1987, of French nationality, had the intention of committing an attack on French soil within the next few days, he said.
At a press conference, Paris Prosecutor Francois Molins said the General Directorate for Internal Security "thwarted an imminent action, that was meant to be led by two suspicious, determined people."
The attack, he said, had been planned to take place within France, but his department could not immediately "determine the exact date, target or circumstances of their action."
Molins said a raid on a Marseille apartment produced, among other items, an ISIS flag, guns, 3 kg (6.6 lbs) of explosives, a map of the city and other paraphernalia that could be used in an attack. One of the men had prepared a video claiming allegiance to the terror group, he said.
They have been charged with criminal terrorist association with the purpose to harm people, and holding of substances or products to build an explosive device.
Both were known to the intelligence services and were on a list of radicalized individuals, and had shared a cell during a prison stint, the prosecutor said.
The first round of France's election is set for Sunday. It has been one of the most unpredictable and dramatic presidential campaigns
in French political history -- and with less than a week to go before the election, the outcome remains too close to call.
If no candidate wins a majority
, as is expected, the top two vote-getters will participate in a runoff election on May 7.
Interior Minister Fekl sought to reassure citizens that the heightened security around the election would ensure that it would not be marred by terror.
Some 50,000 policemen and soldiers will be deployed for the two election rounds, he said.
In recent years France has been the site of several terror attacks carried out by individuals or small groups of perpetrators.
From January 2015, a total of 17 people were killed in attacks
on the satirical magazine Charlie Hebdo, a kosher grocery store, and the Paris suburb of Montrouge.
In November that year, terror attacks in Paris that killed at least 130 people and wounded hundreds. The attackers, armed with assault rifles and explosives, targeted six locations across the city, and ISIS claimed responsibility for the attacks
Last July, on France's Cote d'Azur, around 200 kilometers (125 miles) from Marseille, scores were killed in Nice
as they watched a firework display to mark Bastille Day.
Referring to the election, Fekl said "every effort" was being made to guard against attacks.
"We are mobilized everywhere in France to ensure the safety of the French and the presidential candidates," he said.