Clément Baur, 23, and Mahiedine Merabet, 29, two converts to radical Islam who once shared a prison cell, were detained on Tuesday by police and domestic intelligence agents in the southern city of Marseille.
Police had been searching for them since April 12 following the interception of a video in which the men pledged allegiance to the Islamic State (IS) group.
It has emerged that they had used a number of aliases, switched mobile phones frequently and used pre-paid bank cards to evade police.
"It took a while to find them," said a source close to the investigation.
In the apartment they shared, police found a loaded Uzi sub-machine gun, two pistols, TATP explosives and a homemade grenade.
An IS group flag was also discovered.
With France going to the polls on Sunday in the first round of the presidential election, the discovery raised fears that the men were intending to attack a campaign event.
Following their arrest, representatives of several presidential candidates said French authorities had privately warned them of a threat and circulated pictures of the two suspects.
France's anti-terrorism prosecutor François Molins said in a press conference on Tuesday that Baur had "constantly changed address" and at one point took on the identity of a Chechen jihadist from the Belgian town of Verviers, a jihadist hotbed.
The two men were "equally defiant and determined," Molins said.
Baur was convicted in January 2015 of using false identity documents, appearing in court under yet another identity, Ismail Djabrailov, according to the prison guards' union at Sequedin jail near Lille where he served his sentence.
'I'll hand myself in soon'
While behind bars in the northern city, he met Merabet, a repeat offender with a string of convictions between 2004 and 2013 for offences including aggravated theft and drug dealing, while they shared a cell for 40 days.
Merabet was radicalised by the younger man who "had a big influence on him", a source in the probe said.
In March 2015, Baur's family informed police that he had gone missing and had wanted to go to Syria.
They also told authorities that he practised a radical form of Islam having come into contact with the Chechen community in the southern city of Nice.
That same year he appeared in a Belgian investigation on "jihadist groups", but the Belgian federal prosecutor's office said there was no longer any trace of him in the country by the end of 2015.
While Baur disappeared, Mahiedine Merabet came to the notice of authorities.
In December last year, investigators visited his home in the northern town of Roubaix. Merabet was not at home, but in his place was a man with false identity papers who turned out to be Clement Baur.
On April 4 this year, an envelope was delivered to police headquarters in Roubaix.
It contained a handwritten message from Merabet saying: "I give you my identity card and my bank card... I'll hand myself in soon and we'll talk then... Leave me alone, bye."
That strange message indirectly led to his arrest 13 days later.
France remains under a state of emergency, which has been extended several times, following a string of Islamist militant attacks in Paris and other parts of the country in which more than 230 people have been killed.
(FRANCE 24 with AFP)