Paris: France has foiled a "terrorist" plot to capture and decapitate a member of its armed forces, officials said, underscoring the threat the country faces six months after the Islamist attacks in Paris.

Interior Minister Bernard Cazeneuve said security forces had staged dawn raids on Monday to take into custody four people, aged between 16 and 23, who were "planning to commit a terrorist act against French military installations."

A source close to the investigation into the thwarted attack, who asked to remain anonymous, said the four arrested had been planning to film the decapitation of a member of the military based in southern France.

One of the four people arrested had served in the navy, Cazeneuve said.

The youngest suspect was later freed, a judicial source told AFP.

The mastermind of the foiled attack had been planning to travel to jihadist-controlled areas of war-torn Syria, Cazeneuve said.

The news of the arrests followed a statement from President Francois Hollande, who said attacks had been thwarted in recent days.

"This week, we stopped terrorist attacks which could have taken place," Hollande said on a visit to the southern city of Marseille.

France remains on high alert more than six months after jihadist attacks in January that claimed 17 lives and started with shootings at satirical magazine Charlie Hebdo.

The suspected plotters are now in the custody of France`s intelligence services, the DGSI, and anti-terrorist prosecutors in Paris have opened a probe, Cazeneuve said.

"I want to congratulate our security services for this new blow to the terrorists and for again foiling an attack," said the minister.There are 1,850 French citizens or people living in France who are "implicated" in jihadist networks, with around 500 in Syria or Iraq, authorities said.

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

Authorities have also set up a hotline for friends or family concerned that someone could be tempted to wage jihad -- an effort that has yielded 2,500 leads.

Following controversial "anti-terror" laws passed last year, France is also preventing suspected jihadists from leaving the country -- some 118 travel bans have been enforced since the legislation came into force in 2013.

Cazeneuve said no link had been established between the foiled assault and two blasts on Tuesday at a petrochemical plant near Marseille.

He had earlier told the lower house of parliament that the two explosions appear to have been a "criminal act" but investigators had yet to pin down a motive.

Officials discovered devices thought to have started the twin explosions at the plant in the small town of Berre-l`Etang near Marseille in the early hours of Tuesday, which sparked huge fires but no one was hurt.

Two tanks full of petrol and naphtha -- a flammable liquid distilled from petroleum -- caught fire after the blasts and a thick cloud of black smoke was visible several kilometres away.

Prosecutors said an explosive device was found in a third tank, but had failed to trigger a major explosion.

Paris has also tightened security around sensitive sites such as factories, calling for "maximum vigilance".

But experts have warned it is extremely difficult to defend against attacks on such sensitive sites.

"There is no such thing as zero risk," said Philippe Prudhon, a technical expert at the UIC union of chemical industries.

"If someone really wants to cause harm, it will be difficult to stop him or her. We have to realise that we have been in a fundamentally different environment for the past three years," Prudhon said.

Last month, a man with suspected links to the Islamic State group spiked his boss`s severed head onto the fence of a US-owned gas factory in eastern France.