Rape victims can ward off a “bleak future” by marrying their rapists, an MP and former judge has suggested in the Malaysia parliament.

Former sharia judge Datuk Shabudin Yahaya made the comments at the Houses of Parliament during a debate over a bill on sexual offences against children.

While he acknowledged rape as a criminal offence, Yahaya suggested that rapists and their victims could solve social problems and “turn a new leaf” by getting married.

“Perhaps through marriage they can lead a healthier, better life. And the person who was raped does not necessarily have a bleak future. She will have a husband, at least, and this could serve as a remedy to growing social problems,” he was quoted in the local daily, the Star.

An MP from Barisan National – the coalition that has ruled Malaysia since independence from Britain in 1957 – Yahaya also suggested that girls as young as 12 might be “spiritually and physically” ready for marriage.

Sharmila Sekaran, chair of advocacy group Voice of the Children (VOC), which has been working with the government to draft the new law on child protection, was in the parliamentary session when Yahaya made the comments on Tuesday.

“I was outraged that he would make such a statement. Basically to justify and legalise a wrong, a statutory rape,” she told the Guardian.

“He’s a leader of society, as a member of parliament, and it’s worrying that he has this line of thinking,” Sekaran added.

“It does send a message across the country that it is something that we are supposed to be OK with. That’s a very worrying trend: ‘Go and rape someone and if you get caught offer to marry them.’”

Sekaran said she was also deeply concerned Yahaya would “make the leap” to suggest that girls who physically mature early might be ready for marriage.

Sisters in Islam, an Islamic feminist group in Malaysia, said: “Suggesting that marriage and statutory rape can be conflated is a mockery to Islam. Marriage in Islam is about love, compassion, mutual respect and mutual responsibility between husband and wife... How can there be love and compassion if there is an unfair balance of power between the spouses and a threat of sexual abuse in the marriage right from the start?”

The comments made by Yahaya, an MP from Tasek Gelugor in Penang, also drew criticism from locals in his constituency.

Responding to reports, Penang chief minister Lim Guan Eng said people in the state didn’t want a “monster” as their representative. “We are ashamed to have an MP like this from Penang. Even though he’s not in the state government, he is a black stain for Penang,” said Lim.

Despite the controversial comments child rights activists have lauded the sexual offences against children bill passed by the parliament on Tuesday.

The legislation offers stronger and comprehensive legal protections for children, including a clause that criminalises child grooming, a term to describe the behaviour of an adult who befriends a child, sometimes online, as a prelude to sexual abuse.

The law includes new clauses related to child pornography and acknowledges children as competent witnesses in sexual crime cases.