Religious police caught the couples cuddling and holding hands

A group of unmarried couples were whipped in Indonesia's Aceh province on Thursday after they were caught behaving amorously -- a crime under the conservative region's Islamic law.

Flogging is common for a range of offences in the region at the tip of Sumatra island, including gambling, drinking alcohol and having gay sex.

It is the only province in the world's biggest Muslim-majority country that imposes Islamic law.

The five couples flogged Thursday received between four and 22 strokes from a rattan cane outside a mosque in the provincial capital, Banda Aceh, after they served several months in prison.

Religious police caught the amorous couples cuddling and holding hands or, in some cases, having sex.

The five couples flogged Thursday received between four and 22 strokes.

Hundreds of spectators, including children, watched as a masked sharia officer lashed the offenders as they winced in pain.

"We hope in the future there will be no more cases like this -- it's embarrassing," said religious officer Safriadi, who goes by one name.

In December, two men caught having sex with underage girls were whipped 100 times each in Aceh.

Rights groups have slammed public caning as cruel, and Indonesia's President Joko Widodo has called for it to end, but the practice has wide support among Aceh's population.