A couple in Indonesia has been caned 140 times each for having sex outside marriage and drinking alcohol because it violates Sharia, or Islamic religious law.

The 21-year-old woman fainted after what authorities said was a record number of strokes to be meted out in a public caning session in the Aceh province.

The couple were caned on Thursday along with four others, including an officer from the Islamic police force, who were all found guilty of violating Sharia.

Caning is a common punishment for breaking Islamic law in religiously conservative Aceh, although the practice has long drawn criticism from rights groups who say it's cruel.

Under Aceh's Islamic criminal code, sex outside marriage is punishable by 100 strokes of the cane, while consuming alcohol carries 40 strokes.