The Court of Final Appeal ruled that foreign domestic helpers were not considered "ordinarily residents" because they had entered Hong Kong under highly restrictive conditions.
Holding that the immigration law was constitutional and consistent with Article 24(2)(4) of the Basic Law, the top court has reaffirmed that the government had the power to impose immigration controls.
Chief Justice Geoffrey Ma Tao-li said in a 49-page judgment that the special conditions attached to the domestic helpers' entry into the city had an "important bearing on the nature and quality" of their residence in Hong Kong.
Ma pointed out that domestic helpers were allowed to enter Hong Kong on the condition that they must work as domestic helpers and for a specific employer whose place they must live in.
The duration of their stay was specified in the contract and they must return to their home country at the end of the contract.
The Court of First Instance had ruled that excluding foreign domestic helpers as a class from being "ordinarily residents" was unconstitutional because they lived in Hong Kong "lawfully, voluntarily and for a settled purpose, as part of the regular order of life for the time being".
Ma said although it might often justify the conclusion that would not always be the case.
"In the present case, the court must take as the factual context, the scheme whereby [foreign domestic helpers] are allowed to enter and reside in Hong Kong subject to highly restrictive conditions," Ma said.
"It is clear, in our view, that these distinguishing features result in the residence of foreign domestic helpers in Hong Kong being qualitatively so far removed from what would traditionally be recognised as 'ordinary residence'," the judge wrote.
He ruled there was "no need" to seek an interpretation of Article 158 of the Basic Law, which sets out the power of Beijing to make an interpretation of the Basic Law.
But the court acknowledged that Article 158 fell into the "classification" of a provision in which the court must seek an interpretation from Beijing if needed.
The government had requested the court to seek the interpretation saying it would clarify the binding effect of a 1999 interpretation of a Basic Law provision which set out what persons qualified for permanent residency.
At issue was whether a supplementary statement included in the interpretation was also binding and if so maids and children born to mainlanders would both be denied permanent residency.