The top appeals court in Hong Kong issued a landmark ruling granting spousal benefits to a married gay couple, the latest rebuke to leader Carrie Lam’s government over the issue of equal rights for LGBT people.

In a unanimous ruling, the five justices ruled in favor of a local civil servant who argued that his husband, whom he had wed overseas in a country that recognizes same-sex marriage, was entitled to the same benefits as heterosexual spouses. Hong Kong doesn’t recognize same-sex marriage.

Leung Chun Kwong, who works in the city’s Immigration Department, brought the case after his 2014 marriage to Scott Adams in New Zealand. The Hong Kong government had rejected giving Adams medical and dental benefits, arguing that their marriage was invalid.

The Court of Final Appeal dismissed the government’s argument that the court should defer to the prevailing views of the local community, saying that reasoning was “inimical in principle to fundamental rights.”

The justices also rejected the government’s argument that by denying rights to same-sex couples it was protecting the institution of marriage for heterosexuals.

“It is difficult to see how any person will be encouraged to enter into an opposite-sex marriage in Hong Kong because a same-sex spouse is denied those benefits,” they said. “Second, it is circular logic to justify the restriction of these benefits to opposite-sex married couples simply because heterosexual marriage is the only form of marriage recognized in Hong Kong law.”

Following a court ruling last July ordering the government to give the equivalent of dependent visas to the same-sex spouses of expatriate married couples, Leung’s victory is another sign that the courts are driving Hong Kong’s movement toward equal rights for LGBT people, said Suen Yiu Tung, the founding director of the sexuality research program at the Chinese University of Hong Kong.

“It shows that especially in Hong Kong, when the Legislative Council on any social issue is not moving ahead, then the legal channel is the one to be relied on,” he said.

Lower courts in Hong Kong are considering several cases challenging the city’s ban on same-sex marriages, and Suen said the new ruling will complicate the government’s attempt to keep the prohibition in place.

“I think the government will have a much harder task,” he said.

Yet Hong Kong continues to grapple with the issue of LGBT rights while same-sex marriage is legal in other international financial hubs like New York, London and Sydney.

Last month a Cathay Pacific Airways Ltd. advertisement showing two men dressed conservatively strolling hand-in-hand on a beach set off a controversy. The city’s subway and airport operators initially declined to run the ad though quickly reversed course. The ad is now on display in stations.

Taiwan last month became the first government in Asia to legalize marriage equality, while Japan’s major opposition parties on June 3 submitted a bill calling for same-sex marriage in the country.

The court rulings on LGBT issues show that the rule of law is still strong in Hong Kong, Suen said.

“It’s good that the legal system so far in Hong Kong can be considered as relatively independent and is ruling in favor of LGBT rights,” he said.

In a 2016 survey of more than 1,000 lesbians, gay men and bisexuals in Hong Kong, about 5 percent had same-sex marriages or civil partnerships registered overseas, he said.