Hong Kong's Court of Final Appeal bowed to an edict from Beijing and reversed itself on a controversial immigration ruling today, effectively acknowledging that it accepts China's authority to reinterpret and even override its judgments.

Hong Kong's highest court, countermanding a January ruling, decided that 17 Chinese nationals seeking permanent residence in Hong Kong have no "right of abode" and must return to the mainland immediately.

The court's ruling affects an estimated 6,000 mainlanders living in Hong Kong who now face deportation. Announcement of the decision sparked violent protests by mainlanders outside government office buildings here today. It also drew sharp criticism from liberal politicians and legal experts who charge that Beijing is reneging on its "one country, two systems" promise that would allow Hong Kong to preserve its British-influenced political and legal institutions.

The right-of-abode debate has emerged as the most visible irritant in the Beijing-Hong Kong relationship since the former colony reverted to Chinese control in July 1997. Today's decision culminates more than a year of legal wrangling about the rights of hardscrabble mainlanders to take up residence in this free-market enclave alongside their more prosperous cousins.

In part, the fight is about the loftiest of ideals: democracy, self-government, human rights and respect for the rule of law. But as with many other disputes in Hong Kong, it's about more down-to-earth concerns as well: money, property, jobs and family ties.

The center of the controversy is a disagreement about whether to grant residence to mainlanders who can prove that at least one parent is a legal permanent resident of Hong Kong.

In January, the Hong Kong court ruled that would-be migrants could claim Hong Kong residence if it could be proved that at least one parent is a permanent resident. But today's decision ratifies a much stricter definition endorsed in June by the National People's Congress in Beijing, holding that only those whose parents obtained legal Hong Kong residence prior to the child's date of birth are automatically eligible for permanent residence here.

Mainlanders and their advocates argue that it is cruel to separate children from their parents. But Hong Kong's business barons and the region's Beijing-appointed chief executive, Tung Chee-hwa, have warned that the looser rule would throw Hong Kong's borders open to a flood of unskilled mainlanders who would swamp schools and public housing facilities and exhaust the government's financial resources.

The Tung government has estimated the size of this migrant pool to be as large as 1.6 million people. That's a daunting prospect to the 6 million who already live here.

Opposition lawmakers dismiss the government's estimate as inflated. They call it a cynical attempt by Tung, who urged the National People's Congress to offer a second opinion on the Hong Kong court's January ruling, to exploit the fears and prejudices of the territory's current inhabitants.

The Tung government bristles at the suggestion that the outcome of the 17 plaintiffs' legal challenge was rigged to fit the exigencies of the economy. Tung's government insists the court's about-face--which surprised few when it was announced today--is fully consistent with the language of the Basic Law, the quasi-constitution cobbled together for Hong Kong during the final years of British rule.

The Tung government has long argued that the Basic Law gives Beijing's National People's Congress the right to review decisions of the Hong Kong courts. In June, the congress concluded that the original Hong Kong court finding misconstrued the meaning of the Basic Law--a view the Hong Kong court now apparently shares. Beijing's reassessment "is a valid and binding interpretation . . . which the court of [Hong Kong] is under a duty to follow," said Chief Justice Andrew Li.