Strict laws against homosexuality have come into effect in the conservative Indonesian province of Aceh.
Gay sex between Muslim men or women, both locals and foreigners, can now be punished with 100 strokes of the cane.
The law, passed in 2014 but only now being enforced, has faced opposition by rights groups.
The strictly Muslim province has become increasingly conservative in recent years and is the only one in Indonesia allowed to implement Sharia law.
Under the new laws, adultery also carries a possible penalty of 100 strokes. Those who accuse someone of adultery without proof could themselves face 80 lashes.
"The law is to safeguard human dignity. It is to protect Aceh's Muslims from committing immoral acts," provincial Sharia chief Syahrizal Abbas told the AFP news agency.
But Ismail Hasani, from human rights group the Setara Institute for Democracy and Peace, criticised the law as "cruel, inhumane and against the constitution".
Gay sex is not illegal in the rest of Indonesia.
Aceh has brought in its own laws ever since reaching an agreement with the national government in 2001 to end a separatist movement.
The province has recently seen a deterioration in relations between the Muslim majority and smaller religious groups such as Christians.