KUALA LUMPUR (AFP) - Four Malaysian men have been caned for having gay sex in violation of Islamic laws, with activists on Tuesday (Nov 19) condemning "vicious punishments" they said highlighted a crackdown on the LGBT community.

Rights group say there is a worsening climate for gays in the Muslim-majority country, where authorities have maintained a colonial-era ban on sodomy and mete out harsh physical punishments for same-sex relations.

The men, aged 26 to 37, received six strokes of the cane each in a prison outside Kuala Lumpur on Monday for attempting "intercourse against the order of nature", an offence under syariah law, Amnesty International said.

They admitted committing the offence in an apartment last year, with an Islamic court also fining the men and sentencing them to jail terms of up to seven months each.

Religious authorities found out about the private event by monitoring messages between the men, and then sent a raiding party of 50 officers to detain them, according to Amnesty.

A fifth man convicted with the others was not caned as he is appealing against the punishment, while a further six men arrested in the apartment raid are still facing charges, the rights group added.

"These vicious punishments... are the actual crimes being committed here," said Ms Shamini Darshni Kaliemuthu, Amnesty's Malaysia executive director.

"Malaysia should be creating an environment in which LGBT people are free from discrimination, not ensnaring and beating innocent people."

Gay rights activist Numan Afifi, who has been following the case, confirmed the men were caned. AFP could not immediately contact court officials or the men's lawyers.

Related Story Rising concern in Malaysia's LGBT community after attack on transgender woman

Related Story Malaysia sentences 5 men to jail, caning and fines over gay sex

Malaysia has a dual-track legal system, with syariah courts handling some cases for Muslim citizens. Sodomy is a crime under the country's regular criminal code as well as under Islamic law.

Prime Minister Mahathir Mohamad last year said that Malaysia could not accept LGBT rights such as same-sex marriage, dismissing them as "western" values.

A month before his remarks, two women were caned in a syariah court in what campaigners said was the first time the punishment had been used in Malaysia as part of a conviction for lesbian sex.