A raid on a home in southern France that uncovered a makeshift laboratory with the explosive TATP and other bomb-making ingredients, and led to the arrest of four people including a teenage girl, thwarted an "imminent attack," said the country's top security official.

A police official said the teen arrested by anti-terrorism forces had pledged loyalty to the group Islamic State in Iraq and Syria (ISIS) in a recent video.

People stand in front of an apartment building near Montpellier in southern France where suspects who are believed to have been involved in plotting an attack were arrested by French anti-terror police. (Pascal Guyot/AFP/Getty Images)

Interior Minister Bruno Le Roux said the arrests Friday in three locations in the Montpellier area "thwarted an imminent attack on French soil."

The prosecutor's office said around 70 grams of TATP were seized in the Montpellier-area home of a 20-year-old man, along with a litre each of acetone, oxygenated water and sulfuric acid. TATP, which can be made from readily available materials, was used in the deadly November 2015 attacks in Paris and the March 2016 attack in Brussels carried out by ISIS extremists.

Two other men aged 33 and 26 were arrested along with the girl, 16, according to the prosecutor's office, which handles terrorism investigations in France.

Police say suicide attack planned

A police official, speaking on condition of anonymity, said one of the suspects was believed to be planning a suicide attack, but that the investigation had not yet uncovered a specific target.

The police official said a person in the group had tried to reach Syria in 2015 and was known to intelligence services. The group — notably the girl — attracted new attention with their social media postings, he said.

Prime Minister Bernard Cazeneuve praised the work of anti-terror investigators.

"Faced with the heightened threat, there has been an extremely strong mobilization of our intelligence services to ensure the French are protected to the utmost," said Cazeneuve.

France is still under a state of emergency after several deadly attacks in 2015 and 2016.​