A Sharia court in Indonesia's Aceh province has sentenced two men to be caned in public for having gay sex.
The men were found guilty of violating strict Islamic laws in conservative Aceh and will receive 85 lashes each.
The pair, aged 20 and 23, were found in bed together by vigilantes in March. They have not been identified.
Gay sex is not illegal in the rest of Muslim-majority Indonesia and this is its first such conviction. Aceh is the only province where Sharia is in force.
The sentence is due to be carried out next week.
While the judges did not give the maximum punishment of 100 lashes, the sentence is heavier than the 80 lashes asked for by the prosecution.
Public caning sentences have been handed down previously only for gambling and drinking alcohol.
Aceh has become increasingly conservative in recent years. Strict laws against homosexuality were passed in 2014 and came into effect the following year.
Judge Khairil Jamal told the court that the men had been "proven legally and convincingly guilty of committing gay sex", according to the AFP news agency.
When the sentence was being read out, the two men covered their faces with their shirt and hands.
The pair have been in custody since they were found together
The harsh verdict has been condemned by human rights groups and activists.
"I see this as a criminalisation, a step back for Indonesia and violation to human rights," Dede Oetomo, founder of Gaya Nusantara, an organisation advocating LGBT rights said after the verdict.
Ahead of the ruling, Human Rights Watch had called on Indonesia to release the two men, saying that "the verdict will increase fear among LGBT people not only in Aceh but also in many other, especially conservative provinces" in Indonesia.
The men will be caned during a public ceremony on 23 May in the provincial capital of Banda Aceh - where they were found by vigilantes.
The neighbourhood group filmed themselves kicking and beating the pair and the video was shared widely in Indonesia. Rights groups say anti-gay sentiment is growing in the country.
Aceh was granted special rights to introduce its own stricter Islamic laws more than a decade ago.