An Isis flag, a wig and a mask have been found amid guns and homemade explosives at the home of two men suspected of planning an “imminent” terror attack during France’s presidential election.

Clément Baur and Mahiedine Merabet had pledged allegiance to Isis in a video intercepted by French and British intelligence services on 12 April.

It included footage of children killed in alleged coalition air strikes in Syria and Iraq and showed an Uzi submachine gun on a table, next to the front page of France’s Le Monde newspaper from March.

It was dedicated to Francois Fillon’s election campaign and is believed to be one of the factors leading investigators to believe the plot was timed for voting starting on Sunday.

Francois Molins, the Paris public prosecutor, would not confirm which candidate was targeted but confirmed the three frontrunners – Mr Fillon, Emmanuel Macron Marine Le Pen – had been alerted to the risk.

“Investigators managed to locate the apartment,” Mr Molins told a news conference.

He said a tip-off from another country indicated Merabet was likely to carry out an attack and was seeking to contact Isis militants, either to pledge allegiance or ask the group to claim responsibility for the planned attack.

Clement B (left) and Mahiedine M (right) were arrested in Marseille, southern France (Getty)

“These two radicalised men intended to commit in the very short-term – by that I mean in the coming days – an attack on French soil,” said the interior minister, Matthias Fekl.

They were arrested on Tuesday morning at a flat they had been renting for less than three weeks in Marseille, where the Uzi, two handguns, ammunition, a hunting knife, a map of the city, a balaclava and a GoPro camera were found.

An Isis flag and Quran was discovered, as well as a mask associated with the Anonymous hacking collective and a chestnut wig, suggesting plans for a disguise.

Mr Molins said jihadi propaganda was also found, alongside 3kg of homemade triacetone triperoxide (TATP) explosive drying in three packages – only one of which was ready for use.

The volatile explosive, known as the “mother of Satan”, is cheap to make using commercially available chemicals but difficult to detect, and has become a trademark of Isis’ plots and attacks including in Brussels and Paris.

Isis has shared bomb-making manuals on how to manufacture the substance, while calling on supporters to wage terror attacks against countries in the US-led coalition bombing its ever-shrinking territory in Syria and Iraq.

Baur, 23, is suspected of attempting to join the so-called Islamic State in Syria after being freed from prison, where he had been jailed for petty crime under the name Ismail Djabrailov.

He was put in a cell in Sequedin prison with Merabet, 29, who was serving a jail sentence for drug dealing, and the pair became inseparable.

Baur had converted to Islam at the age of 14 and was in contact with the Chechen community of Nice, while Merabet was suspected of attempting to obtain weapons after being released in 2016.

His former home in Roubaix, near Lille, was searched by counter-terror police who uncovered an Isis flag and jihadi propaganda in December, but Merabet was not there and a “roommate” – later revealed to be Baur – gave police a false name.

Merabet, who had 12 convictions, taunted police in the town by sending them his ID and debit card on 4 April, with the message: “I’m giving you my ID and my card as because of you, I have more use for them.

Terrorism in 2016: Terror attacks in Europe claimed by Isis Show all 9 1 /9 Terrorism in 2016: Terror attacks in Europe claimed by Isis Terrorism in 2016: Terror attacks in Europe claimed by Isis Policemen outside Rouen's cathedral during the funeral of Jacques Hamel, the priest who was killed in a church in Saint-Etienne-du-Rouvray in Normandy on 26 July during a hostage-taking claimed by Islamic State group Joel Saget/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Two jihadists, both 19, slit Hamel's throat while he was celebrating mass in an attack that shocked France as well as the Catholic Church Joel Saget/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Muslims place flowers and hold a minute of silence in front of the church if Saint-Etienne-du-Rouvray, western France, where French priest Jacques Hamel was killed on 26 July Charly Triballeau/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Two people hold each other by the new makeshift memorial in Nice, in tribute to the victims of the deadly Bastille Day attack at the Promenade des Anglais Valery Hache/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis The Islamic State group claimed responsibility for the truck attack that killed 84 people in Nice on France's national holiday. Mohamed Lahouaiej-Bouhlel, 31, smashed a 19-tonne truck into a packed crowd of people in the Riviera city celebrating Bastille Day Valery Hache/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Police work at a site where a Syrian migrant set off an explosive device in Ansbach, southern Germany, on 25 July, killing himself and wounding a dozen others Daniel Roland/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis A Syrian migrant set off an explosion at a bar in southern Germany that killed himself and wounded a dozen others in the third attack to hit Bavaria in a week. The 27-year-old, who had spent a stint in a psychiatric facility, had intended to target a music festival in the city of Ansbach but was turned away because he did not have a ticket Friebe/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis Police officers walk along train tracks in Wuerzburg southern Germany on 19 July, a day after a man attacked train passengers with an axe. German authorities said they had found a hand-painted IS flag among the belongings of the man, an asylum seeker from Afghanistan, who seriously injured four members of a family of tourists from Hong Kong in his rampage Daniel Roland/AFP/Getty Images Terrorism in 2016: Terror attacks in Europe claimed by Isis German police killed a teenage assailant after he attacked passengers on a train in Wuerzburg, southerg Germany with an axe and a knife on 18 July, seriously wounding three people Karl-Josef Hildenbrand/AFP/Getty Images

“I will soon surrender, we will talk. To you the security forces, what do you want from me?

“Let me breathe, I have nothing to say to you. I live on love alone, I meditate. Leave me alone. Bye!”

The group is known to directly target former gang members and convicts looking for redemption in online recruitment, with more than half of known European jihadis having a criminal past.

Baur’s family had alerted authorities to his radicalisation and French officials said he had links to jihadi networks in Belgium, which had started a separate investigation.

The Brussels prosecutor said an alert had been issued over Baur, who was wanted for questioning, but he had not been traced in Belgium since the end of 2015.

The plot was foiled just days before the first round of voting in the French presidential election, where security has taken centre stage following the murder of almost 240 people in two years of terror attacks.