PARIS -- France's top administrative court on Friday overturned a ban on burkinis in a Mediterranean beach resort, effectively meaning that towns can no longer issue bans on the swimsuits that have divided the country and brought world attention to its fraught relationship with Muslims.

The ruling by the Council of State specifically concerns a ban on the Muslim garment in the Riviera town of Villeneuve-Loubet, but the binding decision is expected to impact all the 30 or so French resort municipalities that have issued similar decrees.

The bans grew increasingly controversial as images circulated online of some Muslim women being ordered to remove body-concealing garments on French Riviera beaches.

Lawyers for a human rights group and a Muslim collective challenged the legality of the ban to the top court, saying the orders infringe on basic freedoms and that mayors have overstepped their powers by telling women what to wear on beaches.

Despite the court victory, the debate was unlikely to go away. Prime Minister Manual Valls, who supported the bans, called the debate "fundamental" for secular France, where religious displays are unwelcome in the public space.

Valls wrote on his Facebook page that denouncing the burkini "in no way puts into question individual freedom" and is really about denouncing "fatal, retrograde Islamism." The burkini, he wrote, "is the affirmation of political Islam in the public space."

Mayors had cited multiple reasons for the bans, including security after a string of Islamic extremist attacks, risk to public order, and France's strict rules on secularism in public life.

The Council of State ruled that, "The emotion and concerns arising from the terrorist attacks, notably the one perpetrated in Nice on July 14, cannot suffice to justify in law the contested prohibition measure."

It ruled that the mayor of Villeneuve-Loubet overstepped his powers by enacting measures that are not justified by "proven risks of disruptions to public order nor, moreover, on reasons of hygiene or decency."

"The contested decree has thus brought a serious and manifestly illegal infringement on basic freedoms such as freedom to come and go, freedom of conscience and personal freedom," the ruling read.

Lawyer Patrice Spinosi, representing the Human Rights League, said that women who have already received fines can protest them based on Friday's decision. He told The Associated Press the group plans to ask all French mayors who banned burkinis to withdraw their orders and, if they refuse to do so, he will systematically take each case to court.

"It is a decision that is meant to set legal precedent," Spinosi said to reporters earlier outside the court. "Today all the ordinances taken should conform to the decision of the Council of State. Logically the mayors should withdraw these ordinances. If not, legal actions could be taken" against those towns.

The head of the Collective Against Islamophobia in France, the other group that appealed to the top court, hailed the decision but lamented that the crackdown "will remain engraved in the history of our country."

"One cannot take back the harm which was caused, humiliations that were provoked," Marwan Muhammad told reporters outside the court.

The bans have become a symbol of tensions around the place of Islam in secular France and the heated debate has brought about divisions even among cabinet ministers.

While Valls argued that burkinis oppress women, two ministers in his cabinet, Education Minister Najat Vallaud-Belkacem and Health Minister Marisol Touraine, have said banning burkinis is not a good option. Vallaud-Belkacem, a feminist with North African roots, argued that while she doesn't like the burkini swimsuit, banning the garment amounted to a politically driven act that encouraged racism.

Interior Minister Bernard Cazeneuve, who is also in charge of faiths, said that "it is now up to everyone to seek calm."

The conservative mayor of Villeneuve-Loubet, Lionnel Luca, said that "far from calming, this decision can only heighten passions and tensions, with the risk of trouble we wanted to avoid."

Luca, also a lawmaker, said that now only a law can stop troubles. He denounced a "rampant Islamization" in the country and said that, with Friday's ruling, "they've gained a small additional step."

While addressing only one local ban, the Council of State sets general principles in its ruling that any mayors will now have to abide by when using their powers in the future.

Technically, other local bans are still in effect until mayors revoke them or groups contest them in courts. But de facto the town decrees are hollow because burkini fines can be contested.

Nevertheless, the mayor of the Corsican town of Sisco said he wouldn't lift the ban he imposed after an Aug. 13 clash on a beach. "Here the tension is very, very, very high and I won't withdraw it," Ange-Pierre Vivoni said on BFM-TV.

Former President Nicolas Sarkozy, who announced this week he's seeking the conservative nomination for the 2017 race, said at a rally Thursday night in southern France that he wants a law banning the burkini "on the entire territory of the Republic."

Far-right National Front leader Marine Le Pen said the battle is not over. She said in a statement that lawmakers must vote "as quickly as possible" to extend a 2004 law that bans Muslim headscarves and other ostentatious religious symbols in classrooms to include all public spaces.

"The burkini would obviously be part of it," said Le Pen, who is running for president in the 2017 race.

President Francois Hollande has remained neutral on the issue, arguing that society "presumes that each person conforms to the rules, and that there is neither provocation nor stigmatization."

But critics said the bans had been feeding a racist political agenda.

Amnesty International praised the court decision Friday, calling the local decrees "invasive and discriminatory" and saying their enforcement has led to "abuses and the degrading treatment of Muslim women and girls."

Elaine Ganley, Angela Charlton and Jeff Schaeffer contributed to this report.