A transsexual woman won a groundbreaking court appeal in Hong Kong Monday allowing her to marry her boyfriend and forcing the government to re-write the city's marriage laws.

The woman, known in the Court of Final Appeal as "W" under anonymity rules, successfully overturned earlier verdicts that said marriage is only allowed between couples who were of the opposite sex at birth.

W, who underwent sex realignment surgery more than five years ago, argued that her post-operative gender is recognised by the law and that previous rulings were a violation of her constitutional rights.

She also said that her realignment surgery had been government-subsidised.

The city's Registrar of Marriages had argued that she could not wed her boyfriend because her birth certificate -- which cannot be altered under Hong Kong law -- said she was male.

"It is contrary to principle to focus merely on biological features fixed at the time of birth," the court said in a written judgement by the panel of five judges.

It added that existing laws "impair the very essence of W's right to marry".

In a statement following her victory, W said: "This is a victory for all women in Hong Kong."