An Indonesian man - who worked for an organisation that helped draft strict adultery laws - has been publicly whipped after being caught having an affair with a married woman.
Mukhlis bin Muhammad of the Aceh Ulema Council (MPU) was flogged 28 times.
The woman he had the affair with was caned 23 times.
Mukhlis is from the deeply conservative Aceh region, the only place in Indonesia which practises the strict Islamic law, Sharia.
Gay sex and gambling are also punishable by public caning in Aceh.
"This is God's law. Anyone must be flogged if proven guilty, even if he is a member of the MPU," Husaini Wahab, the deputy mayor of Aceh Besar district, where Mukhlis lives, told BBC News Indonesia.
The couple were caught by officials in September, apparently in a car parked near a tourist beach.
The caning happened on Thursday. Mr Husaini added that Mukhlis would be expelled from the MPU.
The 46-year-old is also an Islamic religious leader. He is the first religious leader to be publicly caned in Aceh since Sharia law came into force in 2005.
The MPU advises the local government and legislature on drafting and implementing Sharia law in Aceh.
Aceh was granted special rights to introduce its own stricter Islamic laws more than a decade ago.
Laws against homosexuality were passed in 2014 and came into effect the following year.
Extra-marital sex, gambling, and the consumption, production and distribution of alcohol are all illegal under Sharia law.
In 2017, two men were caned 83 times each in Aceh after they were caught having sex.
Canes are typically made from ratan. Those carrying out the caning have all their body parts, except their eyes, covered to stop them from being identified.
The caning must take place publicly on an open air platform, though children are barred from watching.
Sharia law applies to Muslims and non-Muslims alike in Aceh.