Two Indonesian men were sentenced by an Islamic Shariah court on Wednesday to receive 85 strokes each in a public caning for having sex with each other.

The lead judge, Khairil Jamal, said the 20- and 23-year-old men were "legally and convincingly proven to have committed gay sex."

Wednesday's verdict was the first time the punishment had been handed down since Aceh province since a local law banning gay sex came into force in 2015. Anyone caught engaging in consensual gay sex could receive up to 100 lashes, 100 months in jail or a fine of 1,000 grams of gold.

The three-judge panel said it decided against imposing the maximum sentence of 100 lashes because the men had cooperated with authorities and had no prior convictions.

Still, the court's ruling was still more severe than the 80 lashes requested by the prosecutor. The men, who represented themselves in court and said they would not appeal the ruling, are expected to be caned next week.

Gay sex is only banned in Aceh province and is not illegal anywhere else in Indonesia, which has the world's largest Muslim population.

Rights groups have said a public caning of the men could constitute torture under international law

Rights groups decry sentence

International rights groups decried the sentence, which was also handed down on International Day Against Homophobia and Transphobia.

"This is barbaric - this is another low point for Aceh, and also for Indonesia," said Andreas Harsono, Indonesia researcher for Human Rights Watch.

Human Rights Watch had previously called on Indonesia to release the men and described their treatment as abusive and humiliating. The group also said that a public caning would constitute torture under international law.

The two men were arrested in late March after vigilantes burst into the boarding house where the couple were staying in the provincial capital Banda Aceh.

Cell phone footage of the arrest that circulated online showed the vigilantes slapping, kicking and insulting the men, with one of them slumped naked on the ground.

Aceh is the only province in Muslim-majority Indonesia that is allowed to practice Shariah law as part of a concession made by the government in 2006 to end a war with separatists.

Indonesia's moderate reputation has been damaged in the past year due a surge in persecution of members in the LGBT community and attacks on religious minorities.

Earlier this month, the outgoing governor of Jakarta, a minority Christian, was sentenced to two years in prison for making comments during his re-election campaign that were deemed as blaspheming the Quran.

rs/rc (AFP, AP, Reuters)