Last Updated | Aug. 26, 10:13 a.m.

Photographs and video of French police officers issuing tickets to Muslim women — for violating new local ordinances that ban modest beachwear as an offense against “good morals and secularism” in more than a dozen towns along the Riviera — spread widely on social networks on Wednesday, prompting outrage and mockery from opponents of the laws.

France’s highest administrative court, the Conseil d’Etat, ruled on Friday that such bans were illegal, but by then the damage to the nation’s reputation had already been done.

But the same images were greeted with undisguised glee by extremists eager to make the case that observant Muslims have no place in European countries. A series of photographs published by the Daily Mail — showing armed officers confronting a woman wearing a headscarf, leggings, and a long-sleeved shirt on a beach in Nice on Tuesday — was hailed by the anti-Muslim Dutch politician Geert Wilders.

David Thomson, a French journalist who tracks jihadi activity online, told Radio France that Islamic State sympathizers on social networks seemed surprised to find police officers in Nice “creating propaganda on their behalf” by providing the perfect illustration of their case that France humiliates Muslims.

“For them, this is a godsend,” Thomson said. “The jihadist narrative has insisted for years that it is impossible for a Muslim to practice their religion with dignity in France.” Within minutes of publication, he said, these photographs became one of the most discussed topics in the online “jihadosphere.”

“These shots of Nice,” he added, “will fuel years of jihadist propaganda.”

The irony, Thomson noted last week, is that the specific swimming costume the bans have targeted, the full-body swimsuit known as the “burkini,” is rejected as immodest by Islamist ideologues. Such costumes, he explained, are the sort of adaptation to Western culture Muslim women in France’s North African colonies were once encouraged to make.

On Thursday, activists from a French anticapitalist party, the NPA, held a demonstration against the ban on a beach in Leucate, chanting: “C’est aux femmes de décider: trop couvertes ou pas assez!” (or, “It’s up to women to decide: too covered or not enough!”)

Protesters in London brought sand to the French embassy for a “Wear What You Want” rally against the bans.

The State Council explained its ruling on Friday to suspend an order issued by the mayor of Villeneuve-Loubet, outside Nice, by saying local officials had exceeded the limits of their authority. Restrictions on the use of the beach by certain persons, the council said, threatened fundamental freedoms guaranteed by French law, such as the freedom of movement and freedom of conscience, that could only be justified by a grave threat to public order. “In the absence of such risks,” the court said, “concerns and worries arising from terrorist attacks, including those committed in Nice on July 14, are not sufficient to justify legally the mayor’s order.”

Although the authorities in Nice confirmed that the incident reported by the Mail did take place — and that at least 23 other women have been ticketed there this week and forced to pay 38-euro fines, or about $40 — defenders of the so-called burkini ban accused the unnamed woman of taking part in a staged “provocation.”

Jérémie Boulet, a member of the xenophobic National Front party, argued that the woman must have been trying to bait the authorities into approaching her by wearing such an outfit on a warm day. He also suggested, incorrectly, that she was not sitting on a towel when approached by the officers.

Christian Estrosi, a former mayor of Nice who is now the regional president of the Côte d’Azur, issued a statement on Wednesday in which he called the behavior of the two dozen women fined for their dress this week “unacceptable provocations” intended to “undermine the city’s police officers.” Estrosi also warned people who share images of the police ticketing women on social networks that they could be prosecuted for endangering the officers.

Nice’s deputy mayor, Rudy Salles, claimed in a contentious radio interview with Razi Iqbal of the BBC that women dressing in such attire to go to the beach must have been coerced into doing so by Islamist radicals.

A French photo agency that acquired the rights to the images told Libération that the photographs were “certainly not staged, as some people have alleged,” and were the work of an unnamed freelancer “who happened to be on the beach at the time” looking for images of the ban being enforced. He was about 100 meters away from the woman when he saw the officers approach and shot the encounter using a telephoto lens.

“The freelancer witnessed the scene, which took place at 11 a.m. on Tuesday and lasted roughly 10 minutes,” the agency, Best Image, said in a statement. “The woman was issued with a fine and left the beach a few minutes later. That is all the photographer was able to see.”

Speculation that the officers could have been set up was fueled by the fact that the photographer’s name was not released, but the incident took place the same day that a French journalist, Mathilde Cusin, witnessed something worse: a woman in Cannes being fined by the police and harassed by onlookers. That woman, a 34-year-old mother who gave her first name as Siam, told Agence France-Presse that she was given a ticket for sitting on the beach with her family, wearing a headscarf and leggings. “I had no intention of swimming,” she said.

In an interview with Le Nouvel Observateur, a weekly magazine, the woman said that she was baffled at first by the police officers who told her that beachgoers were obliged to “dress correctly” according to a new ordinance. When she asked the officers what that meant, she was told that she could only stay on the beach if she agreed to wrap her hijab into a headband.

“My children were crying, witnessing my humiliation,” Siam told the magazine. “Even I could not help crying. They humiliated us.”

During her standoff with the police, a crowd of onlookers gathered. Some of them defended the woman, arguing that she was causing no harm and was not even wearing a burkini. Others, however, taunted her with racist remarks. “I was stunned,” she said. “I heard things no one had ever said to my face, like ‘Go home!’” Siam, who was born to French parents in Toulouse, said that someone else added, “We are Catholics here!”

“People demanded that she leave or remove her veil, it was pretty violent,” Cusin told the magazine. “I had the impression of watching a pack go after a woman sitting on the ground in tears with her little girl.”

“What shocked me is that it was mostly people in their 30s, not the elderly as one might imagine,” Cusin added.

“In the country of human rights, I see no trace of the principles of liberty, equality, and fraternity,” Siam said. “I am outraged that this could happen in France.”

Speaking to the BBC in English on Thursday, Siam said, “I feel like a stranger in my country.”

“Today we are banned from the beach,” she told Al Jazeera’s AJ+ in a video interview. “Tomorrow it will be the street.”

“We are women. We are adults,” she added. “And if the headscarf is a personal choice, and if women want to wear it, why stop them?”

Top photo: At a beach in Nice, France, the text of a bylaw was posted last week that bars women from wearing full-body swimsuits.