Indonesian police have detained 58 men including several foreigners in a raid on a gay sauna, an official said on Saturday, the latest sign of a backlash against homosexuals in the Muslim-majority country.

Police late on Friday raided a building in the capital Jakarta that houses a sauna and a gym after they received information from the public that it was being used for prostitution.

"We secured 51 and seven employees for allegedly providing pornographic services," Jakarta Police spokesman Argo Yuwono said in a statement.

Six foreigners were among those detained, including four men from China, one from Thailand and one from Holland.

Homosexuality and gay sex are legal everywhere in Indonesia except in conservative Aceh province, but police have used the country’s tough anti-pornography laws or drugs charges to criminalise LGBT people in the past.