Hong Kong's top court has ruled against two Filipino domestic workers seeking permanent residency, the final decision in a case that affects tens of thousands of other foreign maids in the city.

The Court of Final Appeal was unanimous in its ruling on Monday, siding with the government's position that tight restrictions on domestic helpers mean they do not have the same status as other foreign residents.

Lawyers for the two had argued that an immigration provision barring domestic workers from permanent residency was unconstitutional.

The decision means Evangeline Banao Vallejos and Daniel Domingo are not allowed to apply to settle permanently after living at least seven years in Hong Kong. Vallejos has worked in Hong Kong since 1986 and Domingo since 1985. Neither appeared at court.

"We are very disappointed," said Mark Daly, a lawyer for the pair. He said Vallejos was speechless after learning about the decision.

"While we respect the judgement we disagree with it," Daly said. He added that the ruling is "not a good reflection of the values we should be teaching youngsters and people in our society."

'Sad day'

The case has split the city, home to nearly 300,000 maids from mainly Southeast Asian countries. Some argue that barring maids from applying for residency amounts to ethnic discrimination.

But other groups have raised fears that the case would result in a massive influx of maids' family members arriving in Hong Kong, straining the densely populated city's social services, health and education systems. Supporters of the maids say those fears are overblown.

Members of an activist group chanted "We are workers, not slaves" and other slogans on the courthouse's front steps after the ruling was released.

"Today is a very sad day for migrant workers in Hong Kong," said Eman Villanueva, secretary-general of United Filipinos in Hong Kong. "The message from the Court of Final Appeal is very unfair and discriminatory."

Hong Kong is a special administrative region of China and permanent residency is the closest thing it has to citizenship.

Foreigners who work in other professions are eligible for permanent residency after living in Hong Kong for seven years. Those who have it can vote and work without needing a visa.

Government figures cited by a lower court in this case said an estimated 117,000 foreign maids had been in Hong Kong for that length of time as of 2010.