Five people - four men and one woman - have been caned in public in the Indonesian province of Aceh.
A couple were punished for adultery, the others for drinking alcohol and gambling.
Aceh implemented Sharia, or Islamic law, in 2002, as part of an autonomy deal offered by the Jakarta government.
Human rights groups have called for an end to flogging in Aceh, Indonesia's most conservative Muslim province, saying it amounts to torture.
Syamsuddin, Aceh's Islamic police spokesman, told the BBC that thousands of people came to watch.
He added that another man was also supposed to be punished, but had escaped from prison.
Adultery, drinking alcohol and gambling are amongt a list of prohibited activities in Aceh, which enforces strict Sharia law.
It was granted the right to enforce these laws as part of an autonomy plan offered by the Indonesian government.
When Sharia was first put into place in Aceh, it wasn't clear how strictly it would be enforced.
But in recent months there have been harsh new punishments announced for adultery and homosexuality.
A Sharia police unit has been set up to ensure everyone abides by the Islamic laws. They patrol the city streets in green uniforms - the colour of Islam.
Human rights groups say Aceh's government must immediately ban caning as a punishment for breaching Islamic law because, they say, it amounts to torture and is not internationally acceptable.