The youngest of three suspects in custody - aged only 17 and identified as Ismael K - was given the order when it became clear he would not be able to leave the country to wage jihad in Syria because he was under surveillance, Paris prosecutor Francois Molins said.

Four young men, including a formal naval signalman, were arrested in dawn raids on Monday, suspected of "planning to commit a terrorist act" at a French military base in the south of the country.

They came into contact with each other via social networks and formed a plan to go to Syria to wage jihad alongside other Isil extremists.

However, Ismael K's mother became concerned about his radicalisation and contacted the authorities. He was subsequently interviewed by counter-terrorism officials and was aware he was under surveillance.

For this reason, the three men used encrypted messaging systems and applications, the prosecutor said.

"There was in particular an exchange between Ismael K and an individual currently fighting with Isil in Syria who - given it was impossible for him to leave France - told him to 'hit on the ground in France'," the prosecutor said.

Ismael K told investigators that the plan was to attack the military base, "kill the soldiers there, decapitate the person in charge of the site, film the whole thing and flee to Syria".

The 23-year-old, identified as Djebril A, had served at the base and suggested striking around the New Year period as it was lightly defended at that time.

He joined the navy in June 2013 as a signalman but suffered health problems and was eventually discharged in January 2015.

They planned to arm themselves with handguns for the attack but no weapons were found when searching their homes, although police seized "paramilitary" equipment - including protective gloves used by jihadists in Iraq and Syria.

The three men are expected to be interviewed by a judge on Friday ahead of possible charges.

"Djebril A, Antoine F and Ismael K have several things in common - as well as their young age," noted the prosecutor.

"We are facing a terrorist threat that we have never seen before - an external threat and an internal threat," Manuel Valls, the French prime minister, said on Thursday.

Although the foiled assault was planned around the first anniversary of the Charlie Hebdo attacks, none of the three alleged plotters indicated that the date was chosen deliberately for this reason.

The government says there are 1,850 French citizens or people living in France who are "implicated" in jihadist networks, with around 500 in Syria or Iraq.

France, which is home to Europe's largest Muslim population, has beefed up security, posting 30,000 police officers and soldiers outside 5,000 sites deemed sensitive such as schools and places of worship.