Two teenagers have been jailed in southern France for their part in a brawl that saw three men violently attacked in front of their children after objecting to sexist comments directed at their wives.

The two couples, a friend and their children were cycling in the city of Toulon in July when the two women were abused for wearing shorts by around 12 youths.

Local prosecutor Bernard Machal said the teens hurled insults at the women, shouting “whore” and “go on, get naked”.

He said: “Their husbands then asked them to respect their wives and this provoked a brawl. The three men were severely beaten in front of their children.

“This was provocation of a sexual nature with the intention of forcing a reaction out of the men present.”

Two members of the gang, aged 17 and 19, were arrested “within 24 hours” thanks to CCTV and were jailed at a hearing in the city on Tuesday.

A preliminary investigation is underway to find the other youths who carried out the attack, Le Figaro reported.

The incident came a month after a local teenager defiantly posted an image of herself on Facebook with the caption “Hello, I am a slut” after being verbally abused in the same town.

Maude Vallet wrote on Facebook in June that she had been accosted by five girls in the street calling her a whore for wearing denim shorts.

She said she asked them why she should cover up when a man “can walk around the centre of town bare-chested without anyone saying anything”.

In pictures: Protest against burkini bans in London Show all 10 1 /10 In pictures: Protest against burkini bans in London In pictures: Protest against burkini bans in London Demonstrators stage a beach party outside the French Embassy, in Knightsbridge, London, in protest against burkini bans PA In pictures: Protest against burkini bans in London Jenny Dawkins, a curate from All Saints Church in Peckham, at an anti-burkini ban protest at the French Embassy in London on 25 August Lizzie Dearden In pictures: Protest against burkini bans in London Demonstrators stage a beach party outside the French Embassy, in Knightsbridge, London, in protest against burkini bans PA In pictures: Protest against burkini bans in London Somayia Khan's six-year-old daughter at a protest against burkini bans at the French Embassy in London on 25 August Lizzie Dearden In pictures: Protest against burkini bans in London Friends Rebecca (L) and Hannah (R) at a protest against burkini bans at the French Embassy in London on 25 August Lizzie Dearden In pictures: Protest against burkini bans in London Demonstrators stage a beach party outside the French Embassy, in Knightsbridge, London, in protest against burkini bans Reuters In pictures: Protest against burkini bans in London Demonstrators stage a beach party outside the French Embassy, in Knightsbridge, London, in protest against burkini bans EPA In pictures: Protest against burkini bans in London Demonstrators stage a beach party outside the French Embassy, in Knightsbridge, London, in protest against burkini bans AFP/Getty Images In pictures: Protest against burkini bans in London People participate in a 'Wear what you want beach party' protest outside of the French Embassy in London EPA In pictures: Protest against burkini bans in London A protester holds a sign which reads "Are you Burkini Beach Body Ready?" as she lies on a beach towel outside the French Embassy in London on August 25, 2016, AFP/Getty Images

They reportedly replied: “Because you’re a woman and should respect yourself, you idiot”.

It comes amid growing tension about the policing of what women wear in France.