The predominantly Muslim country of Malaysia has decided to allow gay characters in films – as long as they repent or turn straight in the end.

The country, which recently banned Bruno for its gay sex scenes, has released new censorship guidelines which are less prohibitive than previously.

President of the Malaysian Film Producers’ Association, Puad Onah, told AFP that the new rules were a reversal.

He said: “We are now allowed to show these scenes. As long as we portray good triumphing over evil and there is a lesson learnt in the film, such as from a gay [character] who turns into a [straight] man.

“Previously we are not allowed to show these at all.”

Scenes with kissing, nudity and obscenity will remain banned.

Mr Onah added: “We can do almost anything now but we are urged to give due considerations on the film’s impact on certain areas like public order, religion, socio-culture elements and moral values.”

Malaysia has strict rules on public morality. Homosexuality is not specified as a crime, but Section 377 of the penal code prohibits sodomy, which is punishable by up to 20 years in prison.

The same law is still in force in other former British colonies, such as Singapore, although the New Delhi High Court in India recently struck it down.

Malaysia also has a prohibition on “gross indecency with another male person,” with up to two years in prison for those found guilty.