France has been battling so-called Islamic State (IS) and other Islamist militants for the past two years. Last month, a soldier received minor injuries when a machete-wielding man tried to enter the Louvre museum in Paris.
The man, a 29-year-old Egyptian named as Abdullah Hamamy, was shot and critically injured. The explosives found in Montpellier on Friday were identified as TATP or triacetone triperoxide.
TATP was used to make bomb vests for the Paris attackers. Meanwhile, the country's top constitutional court struck down a law which penalised those who consult jihadist websites.
The Constitutional Council found that the law infringed on people's freedom of communication unnecessarily.