Indonesia’s Constitutional Court has rejected a push to ban gay and extramarital sex.
An Islamic activist group, the Family Love Alliance, lodged the petition in the court in Jakarta last year.
If successful, gay sex and sex out of wedlock would have been deemed illegal, but the panel of nine judges narrowly ruled against it.
Four of the judges dissented, including the Constitutional Court’s Chief Justice.
“The appeal is rejected in its entirety,” Chief Justice Arief Hidayat told the court.
The decision is a win for the nation’s moderates amid concerns of increasing Muslim conservatism across the country.
Human Rights groups said there had been growing anti-LGBT sentiment in recent years and there were a number of police raids this year targeting homosexual bars and clubs.
“It will not change much while there’s a homophobic situation among law-enforcement officials,” Andreas Harsono from Human Rights Watch said after the decision was handed down.
“More than 200 LGBT individuals were arrested this year.”
Mr Hardsono said the ruling would have gone the other way, if one of the court’s more conservative judges, Patrialis Akbar, was not dismissed from the bench for corruption earlier this year.