Gay people caught having sex in Indonesia's staunchly Islamic Aceh province will from Friday (local time) be punished by 100 strokes of the cane, an official said, despite criticism of the "inhumane" law.
The rule applies to all Muslims including foreigners, provincial sharia chief Syahrizal Abbas told AFP.
The regulation was passed in 2014 amid outrage from rights groups, but officials took a year to educate the public about the new law before it came into effect.
"The law is to safeguard human dignity. It is to protect Aceh's Muslims from committing immoral acts," Abbas said on Thursday, adding it would come into effect the following day.
Gay sex is not illegal in the rest of the country, which mainly follows a criminal code inherited from former colonial ruler the Netherlands.
Aceh province, the only part of the world's most populous Muslim-majority nation that is allowed to implement Islamic sharia law, already carries out public canings for gambling, drinking alcohol and fraternising with the opposite sex outside of marriage.
The new law in the western province also makes adultery punishable by 100 lashes and punishes those who accuse others of adultery without proof with 80 lashes.
Canings – which are carried out with thin rattan sticks in public and aimed at humiliating rather than causing physical pain – can be substituted with payments of pure gold or jail time.
Ismail Hasani, from prominent Indonesian rights group the Setara Institute for Democracy and Peace, criticised the law as "cruel, inhumane and against the constitution" and called for it to abolished.
"The government should not meddle in private affairs and instead guarantee individual rights such as freedom," he added.
Aceh gained a degree of autonomy in 2001 in a deal with Jakarta aimed at quelling a decades-long separatist movement, and has been slowly implementing sharia law ever since.
The introduction of sharia laws has speeded up since Aceh struck a peace deal with the central government in 2005.