BANGKOK — A Malaysian appeals court on Friday struck down an Islamic law that banned men from dressing as women in what lawyers described as a landmark case in the stormy battle for primacy between secular and religious laws.

The unanimous decision by a three-judge panel of the Court of Appeal described the ban on transgender practices as “degrading, oppressive and inhuman.”

The decision overturned a religious law in the Malaysian state of Negeri Sembilan that prohibited men from wearing women’s attire or posing as a woman in public. Transgender women have been subject to arrest, fines and harassment and have been molested by the religious authorities, according to evidence presented in the case.

“A semblance of sanity has returned with this judgment,” said Ambiga Sreenevasan, a lawyer and the former head of the Malaysian Bar Council who was in the courtroom for the decision on Friday in the administrative capital, Putrajaya, about 15 miles south of the largest city, Kuala Lumpur. “The words ‘human dignity’ were repeated many times in the judgment,” she said. “It brings us back to fundamental liberties.”