(Getty)

Two Indonesian men face being hit up to 100 times each with a cane after being reported to the police for engaging in gay sex.

The 20 and 23-year-old men were informed on by their neighbour, who took video footage.

The video shows one of the men naked and visibly distressed as he apparently calls for help on his cellphone, according to the Associated Press.

The second man is repeatedly pushed by another man who is preventing the couple from leaving the room.

Marzuki, head of the Aceh Provincial Sharia Law Department, said the men had “confessed” to being a gay couple.

And the law put into place in the region two years ago allows for up to 100 lashes for morality offences – including gay sex.

Marzuki said residents in the local area had been suspicious of the men because they of their apparent intimacy, and deliberately set out to catch them having sex.

“Based on our investigation, testimony of witnesses and evidence, we can prove that they violated Islamic Shariah law and we can take them to court,” Marzuki said.

Indonesia is officially a secular country, but Aceh, where the two men live, practises Shariah law.

It is the only province in the Muslim-majority country to do so, having won this concession from the government as part of a 2005 autonomy deal.

The agreement was created to end a bloody decades-long conflict between Muslim separatists and the military in which thousands died.

While homosexuality has never been illegal in Indonesia, attitudes towards LGBT people have become steadily more extreme in recent years despite a growing gay population.

The Indonesian Psychiatrists Association classifies homosexuality, bisexuality and being transgender as illnesses.

And in January, petitioners argued in the country’s Constitutional Court that sex outside of marriage – such as LGBT sex – could turn Indonesia into an “uncivilised nation” and should be criminalised.

A gay couple from the country’s North Sulawesi province were arrested last year after they posted photos on Facebook showing them kissing in bed.

Also last year, it was announced that the country’s government would clamp down on gay culture – instituting a ban on online “gay propaganda” after a request from the police.

Communications ministry spokesman Noor Iza confirmed that apps including Grindr, Blued and BoyAhoy would be blocked in the country, claiming they were “promoting gay lifestyles”.