JAKARTA (Reuters) - Indonesian police detained 51 men including several foreigners in a raid on what authorities described as a “gay spa” in Jakarta late on Friday, and some could face up to six years in prison under pornography and prostitution laws.

The arrests are the latest in a spate of high-profile police actions against gay clubs and parties in Indonesia this year that have called the country’s reputation for tolerance into question.

With the exception of the ultra-conservative Aceh province in northern Sumatra, where Islamic law is enforced and two men were publicly flogged last month for gay sex, homosexuality is legal in Indonesia, home to the world’s largest Muslim population.

Among those detained at the spa in Central Jakarta on Friday were four Chinese nationals, a Singaporean, one Thai national, one Malaysian, and one Dutchman, although none of the foreigners would be charged, Jakarta Police spokesman Argo Yuwono told Reuters on Saturday.

When asked about what the people in the spa were doing at the time of the raid, Yuwono noted that it was dark at the time.

“LGBT is clearly between men and men or same-sex relationships. Male prostitution,” Yuwono said, without clarifying further. He said those charged could face up to six years in prison under Indonesia’s pornography law.

“There’s a cashier, the manager there and also those providing facilities like towels and other things,” he said.

Activists say police targeting of consensual gay sex has shone a light on discrimination and harassment in the world’s third-largest democracy.

Andreas Harsono, a Jakarta-based researcher for Human Rights Watch, referred to a pattern of discriminatory police action against lesbian, gay, bisexual, and transgender (LGBT) people in Indonesia.

“If they raided (this club) because they are gay, it is abusive, it is abuse of power,” he said, adding that there is no law against homosexuality as long as relationships are consensual.

“If there is no victim, there is no crime,” he said.

Police often used to the pornography law to “criminalize” such cases, but that law itself is also problematic, Harsono said, noting that people could be charged if they had pornographic material on a cell phone.

“Just imagine if every person in Indonesia had their cell phones checked, how many hundred million people would go to jail?”

In May, officers detained 141 men in a raid on the Atlantis sauna, accusing them of involvement in a gay prostitution ring in a part of Jakarta that is also home to many heterosexual “spas”.

(This version corrects month of floggings in Aceh province to May from last month in paragraph 3)