Hong Kong's top court has ruled that domestic workers are not eligible to apply for permanent residency, ending a two-year battle that has split opinion.
The case had centred on Evangeline Banao Vallejos, a maid from the Philippines who has worked in Hong Kong for more than 17 years.
Domestic workers had argued that denying them permanent residency was unconstitutional.
The ruling has implications for Hong Kong's 300,000 domestic workers.
These workers come mainly from the Philippines and Indonesia, often spending years in the territory.
"The FDH [foreign domestic helper] is obliged to return to the country of origin at the end of the contract and is told from the outset that admission is not for the purposes of settlement and that dependants cannot be brought to reside in Hong Kong," the Court of Final Appeal said in a written judgement.
Ms Vallejos was "speechless but calmly resigned", her lawyer, Mark Daly said.
"While we respect the judgment we disagree with it,'' he said. "[The ruling is] not a good reflection of the values we should be teaching youngsters and people in our society.''
Ms Vallejos had filed the appeal jointly with Daniel Domingo, another Filipino domestic helper, who had lived in Hong Kong for 28 years.
The issue of right of abode is a sensitive subject in Hong Kong, with campaigners arguing that not allowing foreign domestic workers to settle in Hong Kong amounts to discrimination.
Eman Villanueva, spokesman for the Asian Migrants' Coordinating Body, said that the ruling "gave its judicial seal to unfair treatment and the social exclusion of foreign domestic workers in Hong Kong".
An initial ruling from the High Court in 2011 said that domestic workers should not be excluded from a rule that allows foreigners to settle in the city after seven years of uninterrupted residency.
Foreigners in other jobs can apply for permanent residency after seven years, which enables them to work and vote in Hong Kong without a visa.
The 2011 ruling led to protests in Hong Kong, with some anxious that allowing the maids to apply for residency would lead to an influx of domestic workers and place a strain on public services.
In March 2012, the government won an appeal against the High Court ruling.
The government had estimated that 125,000 helpers would be eligible to apply for abode, and if each had a spouse and two children, that number of potential new residents could reach 500,000 - although campaigners said that only a fraction of those eligible were likely to apply.
Monday's judgement by Hong Kong's Court of Final Appeal puts an end to the two year legal battle.
Hong Kong's domestic workers receive a guaranteed minimum wage, statutory holidays and annual paid leave.
But their lack of residency rights means that if they leave an employer, they have only two weeks to find a new job before being required to leave the country.
In Monday's ruling, the top court also rejected a request from the Hong Kong government to seek advice from the Chinese government on the matter. It said that the court was able to reach the ruling through reading Hong Kong's Basic Law alone.
Seeking a legal interpretation from Beijing could potentially have sparked public criticism that the Hong Kong government was undermining its judicial independence.
Hong Kong is governed under the principle of "one country, two systems", under which China has agreed to give the region a high degree of autonomy and to preserve its economic and social systems for 50 years from the date of the handover.