Hong Kong's top court ruled Thursday in favor of a gay civil servant seeking spousal benefits for his partner, saying different treatment based on sexual orientation is unjustifiable.

Immigration officer Leung Chun-kwong had sued both the Hong Kong government's Civil Service Bureau and taxation department for rejecting his application for spousal benefits and joint tax assessment after his same-sex marriage was not recognized.

"We are unable to accept the proposition that heterosexual marriage would be undermined by the extension of the employment and tax benefits to same-sex married couples," the five-judge panel on the Court of Final Appeal said in the ruling.

[SOPA Images/LightRocket/Getty/Kyodo]

The ruling also said it is difficult to see how the civil service secretary, by denying to a married same-sex couple the same employment benefits available to a married opposite-sex couple, can comply with employment policies that seek to eliminate discrimination based on sexual orientation.

Leung and his partner Scott Adams married in New Zealand in 2014. He sought a ruling from Hong Kong's top court after the Court of Appeal, a lower appellate court in the territory, overturned an earlier court decision that had come in his favor.

Leung told Hong Kong media that he welcomes Thursday's ruling, but that it is only a small step forward in the fight for equal rights in Hong Kong.

The Civil Service Bureau said it respects the ruling and will take appropriate action after consulting with the Justice Department.