Two local women, aged 32 and 22, were caned on Monday after pleading guilty in a Malaysian Court to having homosexual relations.

On Aug. 12, the Syariah (Sharia) High Court fined the two women a total of 3,300 ringgit (US$797) and sentenced them to six strokes of the cane each after they pleaded guilty of committing mushahaqah, or sexual relations between women, The Nation reported.

They were charged under the Syariah Criminal Offences Enactment, Section 30. The sentence was carried out in a courtroom with about 150 people watching, but they were not allowed to take photos.

The punishment in conservative northern Terengganu state marked the first time women had been caned for same-sex relations in Muslim-majority Malaysia, AFP reported. Rights groups said the case heightened fears about a worsening climate for the country’s homosexuals.

Prime Minister Mahathir Mohamad denounced the caning, saying he had discussed the issue with his cabinet and they felt the caning “does not reflect justice and tolerance in Islam.”

Presiding judge Kamalruazmi Ismail told people to not reject the two women as they had accepted their punishment and shown repentance. He added that the sentence was meant to serve as a lesson, not to hurt people.

Caning is a form of torture and the punishment “sends Malaysia back to the dark ages,” Gwen Lee, the executive director of Amnesty Malaysia, was quoted as saying by the ABC.

Justice for Sisters and Sisters in Islam, two women’s rights groups in Malaysia, demanded a review of laws about the punishment and called the sentencing a “travesty” and “a miscarriage of justice.”