Ten Indonesian men have been jailed for their role in a sauna sex party that saw the arrests of more than 140 participants back in May.

Homosexuality is not illegal in most of Indonesia but a court used ambiguously written anti-pornography laws to put ten of the party-goers behind bars for two to three years each.

The other men attending the event at Atlantis Spa in Jakarta have all been released without charge, Associated Press reported.

"This punishment is too heavy," said the sister of one of the men. "Because in fact what he did is a private behaviour that does not harm others."

Article 4, paragraph 1 of the 2008 anti-porn laws forbid "perverse intercourse" – an ambiguous clause that can be interpreted to mean any number of things, the South China Morning Post reports.

In the present case, it appears to have been used to convict two visitors to the club who engaged in oral sex, along with several employees, including strippers, security and management.

A British man is understood to have been among the men detained, but he is not believed to have been charged.

The Indonesian LGBTQ community has faced increasing hostility from conservative politicians and religious groups in the recent years.

Police have intermittently raided gay venues and private parties, sometimes arresting men and others forcing them to take HIV tests.

"It's been increasing for two years now," Yulita Rustinawati, an activist, told the Guardian after the raid on the sauna in May.

Homosexuality in Indonesia
Transsexuals and gays display palacards reading 'Lesbian, Gay have skills too' as they take part in a demonstration in the capital city, Jakarta in 2008 Jewel Samad/AFP/Getty Images

"It's bad for democracy, for freedom of expression and freedom of association. We're not sure what the government is trying to achieve. We are queer and we are not going away."

It is not all bad news for the LGBT community in Indonesia, however: On 14 December the Constitutional Court ruled against a group of religious petitioners who wanted to make gay sex and sex outside of marriage illegal. Judges rejected their plea by a slender majority of 5-4.

While the debate about gay rights rages in Jakarta, in some parts of Indonesia the consensus is abundantly clear. In the semi-autonomous region of Aceh, where homosexuality is illegal, two men were caned 85 times in front of a huge crowd in May for having relations.

One of the men told the BBC: "I just want the caning to be over and to go back to my family, I have been deeply depressed. I am trying to pull myself out of a deep black hole."

Rotan caning
A man is publicly caned in Indonesia (file photo) Wiki Commons