Indonesia is set to vote on a plan to outlaw gay and pre-marital sex while beefing up its blasphemy laws in a shakeup fueled by religious conservatism and slammed by rights groups Thursday.

The proposed criminal law overhaul could affect millions in the world’s biggest Muslim majority country, including heterosexual couples who might face jail for having sex outside wedlock, or having an affair.

But there are also fears it could punish the Southeast Asian nation’s small LGBT community as gay marriage is not allowed in Indonesia.

“Indonesia’s draft criminal code is disastrous not only for women and religious and gender minorities, but for all Indonesians,” said Andreas Harsono, senior Indonesia researcher at Human Rights Watch.

“Lawmakers should remove all the abusive articles before passing the law,” he added.

Updating Indonesia’s criminal code — which stretches back to the Dutch colonial era — has been debated for decades.

While a push last year fizzled, the mooted changes now appear set to be voted on in parliament before the end of the month — with strong support from religious groups.

“Even though the criminal code bill that will be ratified still has shortcomings, it’s far better than the (one) today,” said Robikin Emhas, a spokesman for the Nahdlatul Ulama, a major Islamic organization.

Rights groups say the proposals underscore a growing shift towards fundamentalism in a country long hailed for its religious tolerance.

“This is a setback,” said Papang Hidayat, research manager at Amnesty International Indonesia.

“Religious values as a source of lawmaking has now reached the national level — that’s worrying.”

People who have pre-marital or extramarital sex could face between six months and one year in jail, as well as fines, under the changes.

There are also penalties for anyone “showing or offering” contraception to minors under 18.

Indonesia’s Aceh province already imposes Islamic law, and whipping is a common punishment for a range of offenses including gambling, drinking alcohol, and having gay or pre-marital sex.

The proposals call for a wider interpretation of Indonesia’s blasphemy law, which has seen members of religious minority groups, including Christians and Buddhists, prosecuted in the past.

The new law would also criminalize “insulting” the president or vice president, which critics said would be a blow to free speech.

Meanwhile, a trio of canoodling couples were publicly flogged in Indonesia’s Aceh province on Thursday, charged with breaking local Islamic law that outlaws public displays of affection.

Despite international condemnation, whipping is a common punishment for a range of offenses in the deeply conservative region on Sumatra island, including gambling, drinking alcohol, and having gay or premarital sex.

Aceh is the only region in the world’s biggest Muslim-majority country that imposes Islamic law.

On Thursday, a masked sharia officer rained down between 20 and 22 strokes from a rattan cane each on three men and three women caught behaving amorously.

They had all served several months in prison.

One woman winced and fell over from the painful punishment, which was carried out in front of a mosque in the provincial capital Banda Aceh.

Dozens of onlookers, including some visiting Malaysian students, watched the spectacle.

“I’m nervous because this is the first time I’ve seen something like this,” said visitor Muhammad Rushdy.

“But it can serve as an important lesson for us from other countries to comply with local regulations,” he added.

Banda Aceh’s mayor Aminullah Usman repeated his long-held claim that the punishment is a deterrent.

“But we keep telling visitors not to be afraid to visit Banda Aceh… because you won’t be flogged if you don’t break the law,” he said.

Rights groups have slammed public caning as cruel, and Indonesia’s President Joko Widodo has called for it to end, but the practice has wide support among Aceh’s population.

About 98% of the region’s five million residents are Muslim.

© Agence France-Presse