A Malaysian court on Friday overturned an Islamic law that banned cross-dressing, saying it "deprives the appellants of the right to live with dignity.” Three Muslim transgenders won the landmark decision in the conservative Southeast Asian nation, according to media reports.

A three-judge panel of the Court of Appeals in Muslim-majority Malaysia ruled that the law, which was aimed at containing the spread of HIV through homosexual and lesbian activities, failed to address the issues of men affected by a gender identity crisis, Reuters reported. Under the state’s Islamic law, men dressing or acting like women could reportedly face a three-year prison term. A judge reportedly said that the current situation had nothing to do with homosexuality.

"It has the effect of denying the appellants and other sufferers of GID (gender identity disorder) to move freely in public places... This is degrading, oppressive and inhuman," judge Hishammuddin Yunus said, according to ABC News.

A 2012 ruling reportedly said that the three men, who identified themselves as women, must adhere to Islamic law as they were Muslim by birth. The plaintiffs were reportedly arrested under Shariah law in Negeri Sembilan state, south of Kuala Lumpur.

The latest verdict reportedly overturned a 2012 decision but the state’s Islamic Religious Department could still appeal the ruling in the apex Federal Court, The Associated Press, or AP, reported.

"We are thankful and overjoyed. It is a victory for human rights," Nisha Ayub of Justice for Sisters, an LGBT group, said according to AP.

Ivy Josiah of the Women's Aid Organization reportedly said: “This is a win for all Malaysians, as the constitution protects us all, irrespective of ethnicity, gender and class,” adding: "Surely no court, civil or sharia, can refute the fact that human dignity is paramount."