A law that makes gay sex punishable by public caning has taken effect in a conservative Indonesian province.

The law took effect in Aceh province on Friday. It says anyone caught having homosexual sex can face up to 100 strokes of a cane, a fine of up to 1 kilogram (2.2 pounds) of gold (about $37,400) and imprisonment of up to 100 months. Adulterers are also subject to 100 lashes of a cane, but not to the fine or imprisonment.

Aceh is considered more devout than other areas of Muslim-majority Indonesia.

Indonesia's national criminal code doesn't regulate homosexuality, and the central government doesn't have the power to strike down provincial laws.

Human rights groups have criticized the law, which applies to both Muslims and non-Muslims.