(CNN) An Indonesian man has been publicly flogged for adultery, under a draconian law he helped create.

Mukhlis, a member of the Aceh Ulema Council (MPU) in the deeply conservative Aceh province of Indonesia, received 28 lashes in front of a crowd on Thursday after being caught having an affair with a married woman. Like many Indonesians, Mukhlis goes by a single name.

His agency advises the local government on drafting and implementing religious laws.

A video by the AFP news agency shows him grimacing as each strike is delivered onto his back by a masked officer on a stage, in front of a handful of onlookers -- some of whom filmed on their cell phones. The woman with whom he was caught also received a series of lashes.

Aceh, the country's only region to impose Sharia law, uses caning to punish a series of offenses, such as homosexuality, drinking alcohol and having sex outside of marriage.

Read More