Indonesian police said Monday they detained 141 men, including several foreigners, in a raid on a gay event in Jakarta the previous evening.

The move was quickly slammed by human rights activists, who alleged that some of the men were subjected to humiliating treatment by being stripped and photographed, with those photos spread on social media.

Jakarta Police Spokesman Argo Yuwono said the raid was carried out late Sunday as the men, including five foreigners from Britain, Malaysia and Singapore, were attending an event called the "The Wild One" at a four-story shophouse housing a gym/sauna for gay men in North Jakarta.

Ten of the detainees have been charged under the country's 2008 Law on Pornography "for exhibiting themselves or someone else in public by showing nudity," which is punishable by up to 10 years imprisonment, police said.

They said the detainees include the shophouse owner, his staff and some striptease dancers and suspected gigolos.

Lawyers for the foreigners said they were still being held for questioning as of midday Monday.

The coalition of groups supporting the rights of minority groups accused the police of "arbitrarily" raiding the event and detaining its attendees, while treating them in a "humiliating manner."

"The victims were...dragged to the North Jakarta Police Headquarters after being stripped and put onto public transportation. During the questioning, they were moved from one room to another room with no clothes on their bodies," the group said in a statement.

"The detainees had their pictures taken and the pictures have been spread through text messages, social media and news reports," it added

The detention was made only a day before the authorities in the northernmost province of Aceh caned a gay couple under the Islamic sharia law by 85 slashes each.

It was the first homosexuality case to go to court in Aceh, but in 2005, a gay couple was arrested by Aceh sharia police before being released after they signed a statement promising they will no longer engage in homosexual activities.

Except in Aceh, which issued a bylaw against same-sex relationships in 2014, homosexuality is not illegal in the world's most populous Muslim country.

Civil society groups working together with the lesbian, gay, bisexual and transgender community have flourished in the past few years in Indonesia, with a 2014 U.N. Development Program report saying there were such 120 nongovernmental organizations.

Attacks disruptions against any LGBT events by hardliner Muslim groups, however, have forced LGBTs to stay low profile.