Two Malaysian women convicted of attempting to have sex in a car have been caned in front of dozens of people, according to media and a state government official, prompting an outcry from human rights activists.

Key points: The pair had pleaded guilty to attempting lesbian sex, forbidden under Islamic law

The pair had pleaded guilty to attempting lesbian sex, forbidden under Islamic law They were sentenced to a fine and six lashings of the cane

They were sentenced to a fine and six lashings of the cane A state official said the public caning is "to serve as a lesson to society"

The LGBT community is routinely persecuted in Muslim-majority Malaysia, where they are seen as a threat to conservative values.

The women, aged 32 and 22, had pleaded guilty last month to attempting lesbian sex, forbidden under Islamic law.

They were sentenced to a fine and six lashings of the cane.

The sentence was carried out in front of about 100 people at the Sharia High Court in Terengganu, a conservative state ruled by the Islamist opposition party Pan-Malaysian Islamist Party (PAS), according to a report by English-language daily the New Straits Times.

Canings are a contentious issue in the region, particularly in Aceh province in Muslim-majority Indonesia, where in 2017, two gay men were lashed 83 times each after they were found having sex.

Earlier this year a woman was publicly caned in Indonesia for prostitution. ( Reuters: Oviyandi Emnur )

An Indonesian woman was also caned after being convicted of prostitution.

Following widespread international criticism, a decision by the provincial Government earlier this year to ban public canings was met by strong opposition from local parliament, and religious activist groups.

The groups in support of public canings believe it is important for the community to witness the punishment.

In Terengganu, it was the first conviction for same-sex relations and the first time a caning had been carried out in public in the state, Satiful Bahri Mamat, a member of the Terengganu state executive council told Reuters.

"Sharia criminal procedure allows the court to determine where the sentence will be carried out, and requires that it must be witnessed by a number of other Muslims," said Mr Satiful, who attended the hearing.

Mr Satiful said the punishment was "not intended to torture or injure".

"The reason it is carried out in public is for it to serve as a lesson to society," he said.

Malaysia has a dual-track legal system, with Islamic criminal and family laws applicable to Muslims running alongside civil laws.

The caning of women is banned under civil law, but allowed under Islamic laws in some states.

Amnesty International said the caning marked "an appalling day" for human rights in Malaysia.

"Caning is a form of torture, inflicting this brutal punishment on two individuals who engaged in consensual relationships send Malaysia back to the dark ages," Amnesty Malaysia's executive director Gwen Lee said.

"As long as these draconian laws exists, the [LGBT] community is at risk of this punishment."

Malaysian women's groups Justice for Sisters and Sisters in Islam called for a review of laws that allowed the caning of women.

"The execution that took place … is a travesty and a grave miscarriage of justice," the groups said.

The case comes amid concerns around growing intolerance toward the LGBT community in Malaysia in recent weeks.

A transgender woman was beaten up by a group of assailants in Seremban, south of Kuala Lumpur on August 15, in what activists said was part of a growing hostility towards gay and transgender people.

Reuters