Hong Kong’s Court of Final Appeal has ruled in favour of a trans woman seeking the right to marry her boyfriend, ending her three-year-long legal battle and sparking a change in legislation that will affect the city’s trans community as a whole.

The woman, known only as ‘W’, has fought since 2010 to get married to her boyfriend.

Although she underwent gender reassignment surgery in 2008, the Registrar of Marriages told her that she could not marry a man as her birth certificate still states she is male. They claimed this would amount to same-sex marriage, which is not legal in Hong Kong.

As she could not legally change her birth certificate, W took her case to the High Court. She argued that her marriage to her boyfriend would be between two people of opposite genders, making the City’s lack of same-sex marriage laws irrelevant. The case was thrown out.

In April she went to the Court of Final Appeal for a definitive ruling.

On Monday a panel of five Final Appeal judges decided four to one that W should have the right to marry her boyfriend.

The decision will take 12 months to come into effect, which judges say will give the government time to amend its Marriage Ordinance legislation. W will be able to marry her boyfriend after the year is over even if the changes have not been implemented.

The judges said in their ruling: “Viewing the realities of W’s position, by denying a post-operative transsexual woman like her the right to marry a man, the statutory provisions in question deny her the right to marry at all.”

They looked to the examples set by other countries in the Asia-Pacific region which have upheld marriages between transgender people and their partners.

China’s ministry of civil affairs clarified in 2003 that marriage between a transgender person and a partner of the gender they were assigned at birth was not same-sex marriage, and should be allowed. Similar case law has emerged from Singapore, India, South Korea, Japan, Indonesia, Australia and New Zealand.

W’s lawyer, Michael Vidler, read a statement from his client which said: “This is a victory for all women in Hong Kong.

“I’m very happy that the court of appeal now recognizes my desire to marry my boyfriend one day, and that desire is no different to that of any other woman who seeks the same here in Hong Kong.”

W is one of a small number of Hong Kong citizens to have undergone gender reassignment surgery. The procedure was deemed medically necessary for her, and was paid for by government funds.

She was also represented by top UK human rights lawyer Lord David Pannick, who said of the case: “The laws of marriage can and should recognise that sexual identity can change. The right to marry is fundamental… the birth certificate is a record of historical facts.”

Earlier this year Honk Kong lawmakers sparked anger within the LGBT community by refusing to carry out a public consultation on LGBT rights.