Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The seaside French city of Cannes has banned burkinis, full-body swimsuits worn by some Muslim women, from its beaches.

Cannes — home of an annual star-studded annual film festival — is located not far from Nice, where more than 80 people died in a July terror attack on the city's beachfront promenade.

A Muslim woman wears a "burkini" on a beach in Sydney. TIM WIMBORNE / Reuters file

Mayor David Lisnard cited that tragedy and subsequent attack on a northwest France church in an ordinance forbidding swimwear that doesn't respect "good morals and secularism."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Beachwear manifesting religious affiliation in an ostentatious way, while France and its religious sites are currently the target of terrorist attacks, could create the risk of disturbances to public order," the ruling says.

A spokeswoman for his office confirmed that the ordinance — in effect through the month of August, peak tourist season on the French Riviera — applies to burkinis. Violators face a fine.

French soldiers patrol the Promenade in Cannes on Aug. 5. Dan Kitwood / Getty Images

Security has been stepped up across France in wake of the Nice attack, with soldiers prominently patrolling the beaches and promenades of the Riviera.

The ordinance was issued on July 28 but only publicized on Friday.

Lisnard told the Nice Matin newspaper that the ban was designed to "protect the population" in the context of France's ongoing state of emergency and terror threat.

When asked if he thought the ordinance would send a negative message to the numerous Muslim tourists in Cannes, Lisnard replied: "Not at all."

Religious groups vehemently disagreed, with France's Muslim Federation of the South calling it an "illegal" and "abusive" use of power with the unique purpose of stigmatization and exclusion.

"The federation ... is absolutely scandalized," it said in a statement.

France's approach to religious attire has long stoked controversy: The country in 2010 passed a law that bans the burqa, an Islamic veil that completely covers women's faces and bodies.