Updated

A transgender woman has won the right to marry her boyfriend in a watershed ruling from Hong Kong's top court.

The Court of Final Appeal ruled on Monday in favor of the woman, identified only as W. One of the judges on the five-member panel dissented.

The surprise decision brings the semiautonomous Chinese city in line with a few other places in Asia like Singapore, Australia and New Zealand, where transgender people are allowed to marry in their new gender.

W's lawyer, Michael Vidler, said his client was "overjoyed" at the decision.

Vidler said the decision won't take effect for 12 months. That's so the government can have enough time to change marriage laws.

The ruling does not allow same-sex marriage.