BANDA ACEH — The crowd hurled insults while the men winced their way through 83 lashes from a rattan cane on Tuesday as Indonesia’s only province to implement Sharia law punished two young men for gay sex.

“Makan pisang!” one man jeered. The phrase — literally “You eat bananas” — has darker connotations when it’s shouted at two men, both in their 20s, who were caught nude in a rented room by local vigilantes in late March.

“Cane him on the ass so it won’t happen again!” the crowd shouted. “Hit him harder!”

The grim spectacle drew more than 2,000 spectators to Banda Aceh’s Syuhada Mosque, with many saying they arrived to witness what they saw as a necessary measure to uphold Islamic law in this remote province.

“This kind of punishment will strike fear into the people,” Puteri Mentari Bengi, a university student, told VICE News. “I believe what they did — sex outside of marriage and homosexuality — are wrong in the eyes of Islam.”

Shariah authorities brought out four heterosexual couples first. Each of them faced lesser penalties for violating khalwat — an Islamic regulation barring close-proximity contact between unmarried couples. The men whistled at the women, cheering as the hooded executioner’s rattan cane struck their backs with a solid thwack.

But the crowd really roared when the first man arrested for gay sex took the stage. Islamic authorities outlawed sodomy in 2014, expanding Aceh’s Shariah law to clamp down on the region’s LGBT community. Those caught committing sodomy face up to 100 lashes, 100 months in jail, or the forfeiture of 1 kilogram of gold—which is worth more than $41,000 on today’s market.

The man stood stoically, mouthing words under his breath, as three different executioners took turns striking his back with a cane. The crowd cheered with each strike, shouting oohs that grew louder whenever the executioner landed a particularly solid blow. The man needed to take a break halfway through, sipping some water, before the punishment continued.

The second man put on a brave face at the start, but as the strikes started to climb beyond 18 his face twisted up in pain. He gripped the front of his white robe, his face red with agony as the executioner struck away. Authorities called the punishment off at 83 lashes. The crowd howled with approval when the man broke down in tears, sobbing into a police officer’s chest as he was led from the stage.

“As a human, I feel sorry for them,” said Indrayati Sri Maulina, a university student who was watching from the crowd. “I can feel their pain. But, logically, if you do something, you must be ready for the consequences. Especially those two homosexuals. In terms of the law, I feel they deserved that. But as a human being, it must’ve been terrible.”

Aceh adopted its own version of Shariah law after it was granted special autonomy by the central government as part of a ceasefire deal with separatist rebels who had waged an insurgency against the state for decades. The Islamic law initially only applied to Muslims, but in 2014, local authorities expanded Shariah law to govern non-Muslims as well, while also rolling out new laws on liwath (sodomy), musahaqah (lesbian acts), and zina (adultery).

In April of last year, Shariah officials caned their first Christian — a 60-year-old woman caught selling alcohol. The Wilayatul Hisbah, or Shariah police, have also taken to enforcing bans on skinny jeans and rules requiring women to sit side-saddle on motorbikes.

“Islamic Shariah is important in Aceh because the people demanded it,” Marzuki, the head of investigations for the Aceh Shariah police, told VICE News. “But [the canings] aren’t only about Shariah. The purpose is to educate people. That’s why we have to do it publicly. That’s the whole point, so everyone can see the consequences of doing certain actions.”

The canings had a chilling effect on Aceh’s small, and increasingly hidden, LGBT community.

“The law is unfair,” said one man, who declined to be identified out of fear. “We’re scared and worried because our every move is watched. Even the private parts of our lives. We’ve lost our right to privacy.”

The canings were national news in Indonesia, where a countrywide crackdown on the LGBT community was in full swing. Homosexuality is not illegal outside Aceh, but authorities throughout the country have recently staged several high-profile sweeps of hotels and gay saunas, shaming gay men in the press and charging those arrested under the country’s controversial anti-pornography laws.

The law, which carries a maximum sentence of 15 years in prison, outlaws everything from pornography to pornaski — a vague term that allows authorities wide latitude in prosecuting those caught engaging in salacious acts.

Police in the Indonesian capital arrested 141 men at a gay sauna last weekend, charging at least 10 under the pornography law and releasing photos of dozens of shirtless men to the media. Those arrests came less than a month after authorities in Surabaya, Indonesia’s second-largest city, crashed a hotel party and detained 14 men caught watching gay porn for possession of pornography. The police also HIV-tested the men, announcing to the media that five had tested positive.

Amnesty International condemned the arrests, explaining that “ambiguously worded laws on pornography are being used exploited to deliberately target LGBTI people, denying them their basic right to privacy and the right to enter a consensual relationship.”

“These arrests are further evidence of the increasingly hostile environment faced by the LGBTI community in Indonesia,” said Josef Benedict, Amnesty International’s deputy director of campaigns. “This situation has been fueled over the past years by a series of reckless, inflammatory, and inaccurate statements made by public officials, apparently under the guise of ‘defending public morality.’”