An Islamic court in Indonesia has sentenced two men to 85 lashes of the cane for having sex together, judges in the conservative province of Aceh said, ignoring pleas for clemency from human rights groups.
The public caning handed down by a panel of judges is the first time laws against homosexuality, introduced in the province in 2014, have been used.
The sentence was more severe than the 80 lashes requested by the prosecutor.
"The defendants are proven to have committed sodomy and are found guilty," the presiding judge, Khairil Jamal, said in a statement.
The two men had opted to represent themselves in court and said they would not appeal the verdict.
Aceh is the only province in Muslim-majority Indonesia that criminalises same-sex relations and that uses sharia as its legal code in addition to the national criminal code.
Human rights activist cry foul
Human Rights Watch (HRW) had called on Indonesia to release the men who were detained in March after vigilantes reported them to religious police for allegedly engaging in gay sex.
"The verdict will increase fear among LGBT people not only in Aceh but also in many other, especially conservative provinces ... in Indonesia," said HRW's Andreas Harsono.
The lesbian, gay, bisexual and transgender (LGBT) community in Indonesia has faced growing pressure since high-ranking government officials last year expressed reservations about activism by its members.
Three years ago, Aceh province enacted a law that punishes anybody caught engaging in consensual gay sex with 100 lashes, 100 months in jail or a fine of 1,000 grams of gold.
It also sets out punishment for unmarried people engaging in displays of affection, adulterous relationships and underage sex.
Religious police in Aceh have also been known to target Muslim women without head scarves or those wearing tight clothes, and people drinking alcohol or gambling.
Two women were detained in October on suspicion of being lesbians after they were seen hugging in public, and were made to undergo "rehabilitation", media reported.