Brian Molko

British rock group Placebo used their appearance at a Moroccan music festival to protest the kingdom's gay rights record in a performance that saw a band member play a rainbow-coloured guitar.

Seen by tens of thousands of fans at the Mawazine music festival, which runs in Rabat until Saturday, the gesture follows a topless protest by controversial feminist group Femen that saw two French women expelled from the kingdom.  

During Placebo's Tuesday night set, bassist Stefan Olsdal took to the stage playing the brightly-coloured instrument with "489" written on his chest -- a reference to article 489, which stipulates that homosexuality is punishable in Morocco by up to three years in jail.

The gesture caused a storm on social media, with the guitarist writing on his Instagram account that "article 489 condemns homosexuality in Morocco. Still!! Let's get rid of it!"

Hours earlier, two Femen members, both French nationals, were expelled from Morocco after protesting topless in front of Rabat's landmark Hassan Tower.

Morocco's General Directorate of National Security said the pair had "performed an obscene sequence" and were "topless, sporting a slogan that offended public morality."

Images shared on social media showed them embracing each other with their tops off in front of the Hassan Tower, a landmark minaret in the Moroccan capital.

"In gay we trust" is written in black on the torso of one of them.