Two Indonesian men were publicly caned in the Aceh province on Tuesday for consensual gay sex, a punishment that intensifies an anti-gay backlash in the world’s most populous Muslim country.

Gay sex is not illegal in most places of Indonesia but it is in Aceh, where perhaps for the first time gay men have been caned under Islamic law in the province.

Two Indonesian men, who were later sentenced to 85 lashes of the cane for having sex together, are escorted by police into an Islamic court in Banda Aceh.

The punishment was given outside a mosque in the provincial capital of Banda Aceh.

The couple were arrested in March after neighborhood suspected them of being gay and broke into their rented room to catch them having sex.

An Indonesian man is publicly caned for having gay sex.

Muslim women observers cheered as the caning took place.

Syriah policemen hold an Indonesian man after public caning.

Syariah policemen hold an Indonesian man after public caning.

Caning is also a punishment in Aceh for gambling, drinking alcohol, women who wear tight clothes and men who skip Friday prayers.

The pair, aged 20 and 23, were found guilty of having broken sharia rules in conservative Aceh province, the only part of Indonesia that implements Islamic law .

Indonesian women hold smartphones as they watch a man publicly caned for having gay sex.