Banda Aceh, Indonesia (CNN) Two men were caned 83 times Tuesday as a punishment for having homosexual sex in Indonesia's ultra-conservative Aceh province.

Hundreds of people turned out to see the public punishment, held at a mosque in Banda Aceh, the capital of Aceh province, filming the caning on their phone cameras. It is very rare, even in Aceh, which follows strict Islamic law, for two men to be caned for having sexual relations.

The men, aged 20 and 23, were arrested in March by vigilantes. Neighbors had barged into an apartment with the men and filmed them naked with camera phones, according to rights groups. The videos were shared widely in local media.

They were subsequently found guilty of violating Aceh's strict Islamic laws and were sentenced to 85 lashes. On Tuesday, two lashes were taken off because the men had already served two months in prison.

Hundreds of people turned out to see the public caning on May 23 in Banda Aceh.

The punishment site was under tight security. The young men were caned alongside four other couples, who had been found guilty of being intimate outside of marriage.

Read More