Paris (AFP) - The two men suspected of plotting an "imminent" attack ahead of France's presidential election were charged Sunday with terror offences, prosecutors said.

The foiled plot in Marseille sparked fears that the closing days of the campaign could be a target for extremists ahead of Sunday's first round of voting in the country's most unpredictable election in decades.

Elite police and intelligence agents arrested the two Frenchmen -- 23-year-old Clement Baur and Mahiedine Merabet, 29 -- on Tuesday in the Mediterranean port city.

Paris prosecutors said the men are accused of participating in a terrorist conspiracy as well as weapons charges.

After searching the suspects' shared Marseille apartment, authorities said they uncovered an Uzi sub-machine gun, pistols, three kilogrammes (6.5 pounds) of TATP explosives and a homemade grenade as well as an Islamic State group flag.

Police had been searching for them since April 12 following the interception of a video in which they pledged allegiance to IS.

The men had used a number of aliases, switched mobile phones frequently and used pre-paid bank cards to evade police.

Two days after the arrests, 39-year-old Karim Cheurfi shot dead a policeman on Paris's Champs Elysees avenue before being killed by police gunfire.

A note praising the Islamic State group was found near his body.

More than 230 people have been killed in a string of jihadist attacks in France since January 2015.