Two men have been caned 83 times each in the Indonesian province of Aceh after being caught having sex.
The men stood on stage in white gowns praying while a team of hooded men lashed their backs with a cane.
The pair, aged 20 and 23, were found in bed together by vigilantes who entered their private accommodation in March. They have not been identified.
Gay sex is not illegal in most of Indonesia but it is in Aceh, the only province which exercises Islamic law.
It is the first time gay men have been caned under Sharia law in the province.
The punishment was delivered outside a mosque in the provincial capital of Banda Aceh.
A large crowd of observers cheered as the caning took place. “Let this be a lesson to you,” one of the men watching cried out. “Do it harder,” another man yelled.
Earlier, an organiser warned the crowd not to attack the men, saying “they are also human”.
The men were sentenced to 85 strokes but the number was reduced by two because they had spent two months in detention.
Aceh was granted special rights to introduce its own stricter Islamic laws more than a decade ago, and has become increasingly conservative in recent years.
Strict laws against homosexuality were passed in 2014 and came into effect the following year.
In the past public caning sentences have been handed down only for gambling and drinking alcohol.
Indonesia has historically largely been tolerant of homosexuality, but has witnessed increasing official and social hostility towards its small and low-profile LGBTQ community in recent years.
Earlier this month, Indonesian police arrested 14 people in the city of Surabaya for allegedly holding a gay party. They could face charges under ambiguous anti-pornography laws.
On Monday, 141 men were arrested – including a British man – in a raid on what police said was a “gay party” at a sauna in the capital, Jakarta, on similar charges. Most were released on Tuesday.
Rights groups have strongly criticised prosecutions of people involved in same-sex relationships, and the use of caning.
Amnesty International said every human was entitled to a right to privacy and to have consensual relations, but that the two men had been ambushed in their home.
It said caning was a “cruel, inhuman and degrading punishment” and may amount to torture and called on the Acehnese authorities to abandon the practice.
Sign up for GhanaStar.com to receive daily email alerts of breaking news in Ghana. GhanaStar.com is your source for all Ghana News. Get the latest Ghana news, breaking news, sports, politics, entertainment and more about Ghana, Africa and beyond.