Indonesia will make gay sex illegal as a part of a raft of sweeping new laws critics blame on a wave of religious fundamentalism.

The proposed shake up, which also takes aim at condom use and adultery, continues to win unprecedented support ahead of the 2019 presidential elections.

It comes after parliamentary speaker Bambang Soesatyo called this week for a crackdown on the LGBT community's 'excesses'.

Government officials, religious hardliners and influential Islamic groups have lined up to support the new law which bans gay sex in Indonesia

The country's health ministry announced it would release a medical guide classifying homosexuality as a 'mental disorder'.

Gay sex is currently legal everywhere in secular Indonesia except for Aceh where it is banned under the semi-autonomous province's Islamic law.

But that may soon change. Parliament is drawing up the new code with all the major political parties reportedly on board.

The draft is expected to be tabled in the coming months.

Wide swathes of Indonesian society, including heterosexual couples who might face jail for having sex outside wedlock or having an affair, may be affected if the laws pass.

But the Southeast Asian nation's small LGBT community may be the hardest hit

'Some politicians see it as an opportunity to cater to the religious base,' said political analyst Yuventius Nicky.

'There's this supposed morality threat that is being queer.'

Government officials, religious hardliners and influential Islamic groups have lined up to make anti-LGBT statements in public recently.

Last month, Google pulled one of the world's largest gay dating apps from the Indonesian version of its online store in response to government demands.

Muslim protesters pray as they burn an effigy during an anti-LGBT rally in Banda Aceh. The country's health ministry announced it would be classifying homosexuality as a 'mental disorder'

One of two Indonesian men is publicly caned for having gay sex in Aceh in May last year. The United Nations human rights chief blasted the proposed law in a meeting with the President this week

And police have used a tough anti-pornography law to criminalise members of the lesbian, gay, bisexual and transgender community.

The UN human rights chief blasted Indonesia's proposed laws and raised them in talks with President Joko Widodo this week.

'The hateful rhetoric against this [LGBT] community that is being cultivated seemingly for cynical political purposes will only deepen their suffering and create unnecessary divisions,' UN High Commissioner for Human Rights Zeid Ra'ad Al Hussein told reporters.

'Any discriminatory provisions [in the new law] need to be removed,' he added.

WHAT WILL THIS MEAN FOR TOURISTS IN INDONESIA? Tourism plays a hugely important part in Indonesian economy, and some 12million people visited the island nation in 2016. The potential change to the criminal code outlawing gay sex and consensual sex between unmarried men and women would affect tourists as well as Indonesian citizens. Andreas Harsono, Indonesia Researcher for Human Rights Watch, says: 'The wording is anyone who commits this crime, which means locals and also foreigners. 'On paper, the law will affect anyone, however, it might not be enforced against tourists, at least not in multicultural areas. It can depend on how much a hotel cooperates with police. 'In strict Muslim areas, such as Aceh and West Sumatra, couples already have to prove that they are married when they book a hotel room together.' Advertisement

The code's latest draft carries a five-year jail term for extramarital sex or adultery, fuelling concerns that same-sex couples, who cannot marry in Indonesia, could be caught up in the dragnet.

It also carries penalties for 'showing or offering contraception tools without authorisation' and calls for stiffer blasphemy sentences.

Supporters of the changes include the Family Love Alliance, a lobby group which made a failed attempt to get the constitutional court to outlaw extramarital and same-sex relations.

Last month, police in Aceh made global headlines by publicly humiliating a group of transgender women, in the latest challenge to Indonesia's reputation as a bastion of progressiveness and religious tolerance.

'If these laws were passed it would give them (police) legitimate reasons or a basis for them to conduct these kinds of raids,' said human rights lawyer Ricky Gunawan.

'This is a worrying and alarming trend of persecution against LGBT and other minorities.'

Hardliners' ultimate goal, some say, is nationwide Islamic law modelled on Aceh, where public flogging is a common punishment for a slew of activities that are legal elsewhere in Indonesia, including pre-marital sex and selling alcohol.

'This is their grand scheme,' said LGBT activist Dede Oetomo.

The idea is not without public support.

A poll last month said nearly 90 percent of Indonesians felt 'threatened' by the LGBT community, while a 2013 Pew survey said 72 percent of Indonesian Muslims supported replacing the secular code with Islamic law.

A sign prohibits prostitution or any kind of sexual acts including kissing or hugging at a park in Tangerang, in the suburbs of Jakarta

In a case that highlighted growing links between politics and religion, Jakarta's first Christian leader was jailed on blasphemy charges levelled by supporters of his challenger, who won a come-from-behind race for city governor.

Rights groups are now scrambling to muster resistance to the proposed laws with a nearly 57,000 signature petition.

Widodo has veto power, but he needs to buoy support among increasingly influential Islamic groups ahead of a 2019 re-election bid.

'People in the government are carefully trying to fend that off,' said rights lawyer Gunawan.

'Gay sex is deplorable,' Alliance leader Rita Soebagio told AFP.

But the new law 'does not mean that many people would be arrested. It's just like when the law on corruption was passed, not everybody was arrested for corruption'.