A controversial ban on the burkini was overturned by France’s highest administrative court on Friday, prompting a Right-wing backlash as mayors vowed to defy the ruling.

The State Council’s judgment suspended a ban in the Riviera resort of Villeneuve-Loubet and set a legal precedent for about 30 other towns that have also prohibited the full-body swimsuit worn by a minority of Muslim women.

The council ruled that mayors overstepped their powers by introducing the bans this month amid growing anxiety over security after a series of terrorist attacks including the Bastille Day massacre of 86 people in Nice.

“The emotion and the anxieties resulting from the terrorist attacks and especially the one committed in Nice on July 14, are not sufficient to justify legally the prohibition,” the judgement said.

The ban “constituted a serious and manifestly illegal infringement of fundamental liberties”, it said, ruling that mayors “may only restrict freedoms if there are confirmed risks” to public safety, which it said was not the case with the burkini.

Lionnel Luca, the mayor of Villeneuve-Loubet, said: “This decision, far from pacifying, will serve only to heighten tensions which will carry risks of trouble which we wanted to avoid.”