Two Christians were flogged in public for taking part in what is considered an anti-Islamic children's entertainment game in Indonesia.

The duo was beaten with a rattan stick outside a mosque in Aceh province as spectators, some of them jeering, took pictures of the flogging.

"This is to create a deterrent effect, in order for people not to repeat violations of Islamic sharia law," said Banda Aceh's Mayor Aminullah Usman, according to the AFP news agency. "We purposely do it in front of the public... so it won't happen again."

Aceh is the only province in Indonesia where strict Sharia laws are in force. Anyone found violating the laws is given severe punishment including whipping. Those who routinely face such punishment include transgender people, homosexuals and those who consume alcohol.

Homosexuality is legal across Indonesia, the world's most populous Muslim-majority nation, except for the conservative Aceh. The region was granted special autonomy in 2001 to frame its own rules on religious matters.

The latest to be punished were Dahlan Silitonga, 61, and Tjia Nyuk Hwa, 45, who were playing a local children's game in which the players can exchange coins for cash or other items. They were accused of gambling.

"You are old, show remorse," chanted the crowd, which include scores of visitors from neighbouring Malaysia.

Apart from the two Christians, three others were also publicly flogged for other "crimes" such as showing affection in public. In January 2018, a Christian was flogged in Aceh province for reportedly selling alcohol.

Man caned for allegedly being gay Indonesia
Non-Muslims, transgenders and homosexuals are frequently punished in Indonesia's Aceh province- file photo CHAIDEER MAHYUDDIN/AFP/Getty Images