Trans people in Hong Kong will not be allowed to have their gender officially recognised on their identity documents unless they undergo sex reassignment surgery, a court ruled on Wednesday.

Residents are currently assigned as male or female on their ID cards -- and what goes on the so-called "sex entry" depends on the sex assigned to each person at birth.

Compared to many Western cities, campaigners have criticised Hong Kong as lagging behind on issues of equality, including LGBTQ rights.

The latest ruling comes after two transgender men challenged Hong Kong's policy of only allowing people to officially change their gender on their ID cards after surgery.

No non-binary option is available, nor is the possibility of altering the marker without undergoing surgery.

The two men -- named "Q" and Henry Tse -- last year mounted an appeal to denounce the policy as a human rights violation.

But the Court of Appeal on Wednesday said authorities must have a "clear, definite, consistent and objective yardstick" to determine a person's gender.

Surgery would give a trans person "clear and irreversible resemblance closest to the preferred sex" and anything short of that would lead to ambiguity, judges added.

The judges also added they were "profoundly conscious of the hardship" the applicants had to endure, but that their ID cards would only be checked occasionally.

The latest ruling comes after two transgender men challenged Hong Kong's policy, denouncing it as a human rights violation
The latest ruling comes after two transgender men challenged Hong Kong's policy, denouncing it as a human rights violation AFP / Robyn Beck

Tse -- who on Wednesday was photographed leaving the court wearing a face mask that reads "Trans rights are human rights" -- had first brought his case against the government in 2017.

He alleged that the ID card policy had the effect of coercing trans people to undergo sex reassignment surgery despite health risks.

Advocates for transgender rights globally have long waged a cultural battle to educate people that gender identity is not defined by biological traits from birth and that not all trans people choose to undergo surgery.

Joanne Leung, chairperson of Hong Kong's Transgender Resource Centre, expressed disappointment at the lack of knowledge shown by the judges.

"The court has a very limited understanding of what sex and gender are, and still upholds a binary separation of biological sex," Leung told AFP.

Last May, more than half of 234 transgender people surveyed by the Chinese University of Hong Kong said they faced discrimination, with many reporting symptoms of depression.

The self-dubbed "Asia's World City" still has a long way to go, according to activists, with discrimination towards sexual minorities remaining baked into the law.

Hong Kong was originally expected to host the 2022 Gay Games but organisers pushed it back for a year, citing pandemic travel curbs.

The city's pro-Beijing politicians tend to skew socially conservative and there is little political appetite from Hong Kong's unelected leaders to embrace LGBTQ rights.