Several people protesting peacefully in Marseille against the trial of the Russian punk band Pussy Riot were detained by police for wearing balaclavas, under France's controversial law that bans Muslim niqabs and all face-coverings from public places.

About 30 demonstrators gathered outside the Russian consulate in the southern French city on Friday to protest against the trial of members of the feminist group famous for wearing bright dresses and colourful balaclavas.

But police swooped on about seven wearing multicoloured face-masks in solidarity with the band, reported La Provence. Asked why the police had stopped the demonstrators who had been standing peacefully behind a banner about the power of poetry, a senior officer told the newspaper: "They are wearing balaclavas in a public space. It's illegal." He said the demonstrators would be questioned and a report written.

In April 2011, Nicolas Sarkozy's government introduced a law banning women from wearing the niqab, or full face-veil, in public places. To circumvent accusations that the law singled out Muslims, the bill was officially called the law against covering one's face in public places.

Special exemptions were created for motorcycle helmets or sports equipment such as fencing masks. There are also exemptions for people appearing in parades, celebrations or places of worship.

The Marseille protesters – including poets, a book editor, and a former culture official – who had removed their masks at police request, were put in a riot van and driven to the nearest police station amid cries of "Absurd!" and "Ridiculous!". They were released that afternoon. Under the law, the case can be referred to a local judge who can hand down a €150 fine, a citizenship course or both.

"We came here to defend freedom of expression in Russia and we find ourselves stopped by French police," one pensioner at the rally told the paper.

When three members of Pussy Riot were sentenced to two years in prison for hooliganism on Friday, France said the sentence was "disproportionate".