RENNES, France (Reuters) - Some 20 French mayors have banned glyphosate from their municipalities, defying the government, which is now taking legal action to impose national legislation which allows the controversial weedkiller’s continued use for now.

FILE PHOTO: A can of glyphosate weedkiller is seen in a treated mustard field as French farmer Herve Fouassier attends an interview with Reuters in Ouzouer-sous-Bellegarde, France, November 30, 2017. REUTERS/Christian Hartmann/File Photo

In 2017, President Emmanuel Macron had pledged to ban glyphosate in France within three years, rejecting a European Union decision to extend its use for five years after heated debate over whether glyphosate, developed by Bayer-owned Monsanto, can cause cancer. But Macron has since said that a blanket ban is not possible within that time frame.

Bayer says regulators and extensive research have found glyphosate to be safe.

On Thursday, the administrative tribunal of Rennes, western France, heard the mayor of Langouet, Brittany, who has banned the use of pesticides in his town within 150 meters of people’s homes and workplaces.

Mayor Daniel Cueff told the court - which is set to rule next week - the ban was aimed at protecting residents from molecules considered a health risk.

About 300 people attended the hearing and nearly 100,000 have signed a petition to support Cueff’s ban.

A lawyer for the French state argued that is not in a mayor’s powers to ban phytosanitary products, which are regulated by the agriculture ministry.

The ministry declined to comment, but Agriculture Minister Didier Guillaume said in January France will phase out 80% of its glyphosate usage by 2021. [reut.rs/2PbvrGE]

Farmers’ unions opposed the ban, saying there are no viable alternatives for the chemical and that a transition to organic farming is too costly.

Allowing the mayor to override the state over glyphosate “would be the return of the local barons and the reign of the lords over their serfs,” Cedric Henry, head of Brittany farmers union FDSEA-35 said in a statement.

Under current legislation, glyphosate application needs to stay five to 10 meters away from housing. Wheat growers’ union AGPB said in a statement that extending the non-treatment zone would withdraw thousands of hectares of land from production.

Environment Minister Elisabeth Borne said on Wednesday that the government would review pesticides regulation soon.

The government is also disputing local glyphosate bans in several other rural communes around France.

Glyphosate is widely used in France, the European Union’s largest grain producer, mainly by farmers, gardeners and railway operators who want to get rid of unwanted grasses at low cost.

Developed by Monsanto under the brand Roundup, Glyphosate is now off-patent and marketed worldwide by dozens of other firms including Dow Agrosciences and BASF.