JAKARTA, Indonesia (AP) — Indonesia's top court has ruled against petitioners seeking to make gay sex and sex outside marriage illegal.

A majority of the nine-judge panel of the Constitutional Court on Thursday rejected the arguments of a conservative group, the Family Love Alliance, that was behind the case.

Rights advocates had feared the court would outlaw gay sex and sex outside marriage and set back human rights in the world's most populous Muslim nation.

Judges say it's the not court's role to criminalize private behaviour.

Four judges argued to outlaw same-sex relations and sex outside marriage.