(CNN) In less than 18 months, being gay in Indonesia has gone from widely tolerated to just plain dangerous.

An unprecedented wave of police raids, vigilante attacks, and calls for the criminalization of homosexual sex have left many in the country's LGBT community fearing for their safety.

"(Gay Indonesians) are exhausted and they're horrified," Kyle Knight, a Human Rights Watch researcher with the LGBT rights program, told CNN.

"Even the activists I know who started the very first organizations in the 1980s say they've never seen anything like this."

It's a dark turn for a country that for decades prided itself on its diverse, heterogeneous society.

The world's largest Muslim democracy, Indonesia is often considered something of a bulwark of tolerance amid growing conservatism elsewhere in the Islamic world.

In less than two weeks, two young men were seized by vigilantes who burst into their home in Aceh province, then taken to authorities who caned them for having homosexual sex

In a separate incident, later in the month, attendees at an alleged gay party in a Jakarta sauna were arrested and images of their faces were disseminated online by Indonesian police.

Homosexual sex is not illegal in the majority of Indonesia, except in the extremely conservative province of Aceh. Jakarta is not part of any province; it is controlled by the central government.

One week ago, West Java Police Chief Anton Charliyan announced that he would create a special taskforce to crack down on LGBT people.

"They will face the law and heavy social sanctions. They will not be accepted by society," he said.

Homosexuality tolerated, not accepted

It wasn't always this way.

Despite being a Muslim-majority country, only small parts of Indonesia — such as Aceh province — follow strict Islamic law.

Same-sex relations have never been illegal either, even if a 2013 Pew survey found that 93% of the country refused to accept homosexuality.

Jonta Saragih a former LGBT activist from Sumatra, now studying in the UK, said while his family weren't quick to accept him when he came out, Indonesians used to have a live and let live attitude to their country's LGBT population.

"[Even] a few years ago, when I was in Jakarta, though homosexuality was not recognized by the law, there was no one talking about it," he told CNN.

Indonesian human rights activist Tunggal Pawestri corroborates this notion that homosexuality was previously frowned upon but tolerated.

"Since my childhood I was told that LGBT people are sinful, being a homosexual is sinful but of course ... it doesn't mean you have to criminalize them," she said.

So what changed?

Anti-LGBT activists protest on February 2016 in Yogyakarta, Indonesia.

Gay rights worse than 'nuclear war'

The problems began in early 2016, when a number of high-profile Indonesian politicians, including several government ministers, suddenly started to make unprompted attacks on Indonesia's LGBT community.

Among them was the Defense Minister, Ryamizard Ryacudu, who said Indonesia's LGBT movement was more dangerous than "a nuclear war."

"In a nuclear war, if a bomb is dropped over Jakarta, Semarang will not be affected -- but (with LGBT rights) everything we know could disappear in an instant -- it's dangerous," he said, according to the state Antara news agency.

Soon, the country's medical professionals joined in. The Indonesian Psychiatrists Association issued a statement in February saying people who were gay or bisexual had "psychiatric problems.

By August, a group of conservative activists had taken a case to the Constitutional Court to call for homosexual sex to be made illegal in Indonesia

Knight said it's hard to tell why the sudden wave of anti-LGBT feeling swelled up across the country, but where it was heading appeared much clearer.

"This is fueled not just by bigotry and misunderstanding but by public officials ... I think that's the really scary thing as we go forward. It's fair game to go after LGBT people in Indonesia," he said.

University student Jonta Saragih found it hard to get acceptance from his family when he originally came out as a gay man in Indonesia.

More than a dozen gay dating apps, including Grindr, were banned in Indonesia in late 2016, Jonta said, making it harder for gay men and women to communicate with each other.

"(I have) some good friends ... we started discussing these issues on social media, eventually some of them deleted me on Facebook. They said we are not friends anymore," Jonta said.

Pawestri blamed vocally conservative politicians and an "irresponsible" media for the rise in anti-LGBT rhetoric.

"Before LGBT Indonesians had quite a lot of confidence, now they're very careful and cry to me, calling me at night. We've been trying to do whatever we can to avoid (criminalization)," Pawestri said.

JUST WATCHED Jakarta governor gets two years for blasphemy Replay More Videos ... MUST WATCH Jakarta governor gets two years for blasphemy 01:50

Showdown at the Constitutional Court

Criminalization might be closer than most would expect.

Since August, a team of lawyers has been arguing in Indonesia's Constitutional Court, on behalf of 12 individuals, to change the criminal code.

Prosecution legal team spokesman, Feizal Syahmenan, told CNN they would like three articles changed in the criminal code -- one to outlaw sex outside of marriage, one to outlaw homosexual rape and one to outlaw homosexual sex entirely.

Two of those 12 individuals are members of the AILA, the Family Love Alliance, a prominent conservative Islamic group.

Syahmenan told CNN homosexuality is just not Indonesian.

"All of these three (laws) are totally wrong and against Indonesian norms and values," he said. "We're not trying to push for implementation of Sharia (Islamic) law."

An Acehnese man being whipped for having same-sex relations in Banda Aceh, Indonesia on 23 May 2017.

If the Constitutional Court finds in favor of criminalization, it would still need to be passed by Indonesia's Parliament before it would take effect, but Knight said it would put huge public pressure on the country's politicians to follow through.

"There are some dark storm clouds on the horizon. If you read the transcripts on the hearings that have taken place since last August, you don't see (judges) pushback from the bench (on witnesses) ... they ask more questions, 'tell us more about the evils of homosexuality'," he said.

"It's ominous, it's very, very threatening."

Hearings concluded in February, with a verdict expected after June, according to Syahmenan.

An Indonesian policeman stands guard outside the Constitutional Court in Jakarta in August 2014.

Where is Joko Widodo?

One politician who has been mostly silent amid the ongoing discrimination against LGBT citizens in Indonesia has been Indonesian President Joko "Jokowi" Widodo.

When he was elected in 2014, there was a huge sense of optimism around Widodo who was considered a "progressive force" for the nation.

But amid the nationwide crackdown on LGBT people, the president has only spoken out once in their defense.

"There should be no discrimination against anyone," Widodo told the BBC in October 2016, adding "the police must act" against any attempts to harm LGBT people.

Indonesian President Joko Widodo (C) meets Indonesian workers during an event in Hong Kong on April 30.

But he then added that in Indonesia, "beliefs (generally) do not allow (LGBT), Islam does not allow it."

Human rights activist Pawestri said many gay Indonesians have been disappointed by Widodo's lackluster defense of their rights. "LGBT people realize that his silence means no protection from the government, and this is totally unjust," she said.

Even if Widodo wanted to help, Knight said it could cost him huge political capital, something he might be reluctant to spend ahead of his 2019 reelection campaign.

"(They) could really do a lot of good by coming out and issuing a statement of support ... They're taking a very cowardly and silent stance, letting it go forward ... Until someone puts a lid on this, it's going to keep unraveling," he said.

Men convicted of gay sex, center, are mobbed and filmed as they head to a mosque to be punished in May.

Battle for Indonesia's soul

Knight said nothing will change until those in authority stand up for the rights of gay citizens across Indonesia.

"We need some leadership here ... Is there any chance [the crackdown] is going to stop? Of course, but it's going to take a constitutional court actually upholding the constitution, it's going to take members of the cabinet stepping out and saying, 'no this is not how we behave,' it's going to take the President," he said.

Syahmenan said the battle over the gay Indonesians' rights was about reaffirming "Indonesian norms and values," adding legal same-sex relations were a relic of colonial rule.

He said gay and lesbian people are a danger to the future of Indonesia. "Look at the children, they like to imitate or copy what the adults do. If they see free sex practices or LGBT, they may think that the practices are something fun and cool," he said.

Despite the current situation, Jonta still believes the future could be bright for Indonesia's LGBT citizens.

"I have this willingness to continue to fight for a better Indonesia. To fight for inclusiveness. Of course it will be more difficult for us to continue the work of human rights," he said.

"We are getting oppressed, even our social media and our websites ... but I would say I'm still optimistic."