Two men were publicly caned 77 times each in Indonesia's conservative Aceh, the only province in the country to practice Shariah law after neighbors reported them to Islamic religious authorities for engaging in a sexual act.

The police arrested the men, aged 27 and 29 after neighbors became suspicious of their relationship. They barged into their rented room and caught the two having sex, Heru Triwijanarko, Aceh's acting Sharia police director, said.

The caning took place at Banda Aceh's Tamansari city park. The two men were made to stand in the center of a circle, as around a hundred people watched and took pictures of the punishment.

Human rights organizations have denounced the spectacle as medieval and brutal. It was the third time that Aceh has caned people for homosexual acts since the Islamic law was enforced in 2015 as a compromise deal carried out by the government to put closure on a long-running separatist insurrection.

Amnesty International Indonesia's monitoring indicates that Aceh has conducted at least 60 public canings against 254 people in 2020 – 52 of which were carried out after the coronavirus outbreak in Indonesia started.

The two were sentenced last month to 80 strokes each but only given 77 after they had spent some time in detention. Local media reported that the officer's stick broke as it hit one of the men, but it was immediately replaced.

The two men cried in pain and begged for the caning to stop as they were struck with a rattan stick on Thursday. The mother of one man fainted as she witnessed the punishment, Agence France-Presse reported.

Consensual sexual relations of the same sex remain decriminalized in the rest of Indonesia outside of Palembang and Pariaman in the provinces of South Sumatra and West Sumatra, respectively.

The Indonesian government has faced mounting condemnation in recent years over its LGBTQ rights record, including the apprehension of 51 people who were joining a "gay party" in Jakarta in 2017.

Eight people have so far been punished this year, with four others caned on Friday. Two men were flogged 40 times each for drinking liquor, while a man and a woman were caned 17 times each for engaging in sexual acts outside of marriage.

A Shariah code requires up to 100 flogs for immorality including gay sex. Lashing is also punishment for gambling, adultery, and for women who wear tight clothes and men who skip Friday prayers.