HONG KONG — For years, Hong Kongers have nursed complaints about the growing parade of visitors to their city from mainland China. The mainlanders spit, litter, jaywalk and cut in line, the locals grouse; they talk too loudly, eat on the subway and otherwise flout Hong Kong’s more refined standards of public behavior.

Those are quibbles, though, compared with the uproar over the latest mainland invasion: pregnant women flocking here to give birth.

The appeal of Hong Kong, a former British colony that is now a semiautonomous Chinese region, is understandable. Medical care here is far superior to what is found in most of China. Chinese children born here automatically receive the right to permanent residency in Hong Kong, entitling them to 12 years of free education and other benefits that are not available to mainlanders, including visa-free travel to many foreign countries. Some parents also sidestep China’s family-planning rules, which limit most couples to one child, by having their second child born offshore.

Hong Kong residents, though, are outraged that local pregnant women are being shut out of maternity wards because mainlanders have snapped up the beds. Despite official quotas on maternity care for nonresidents, nearly 4 in 10 births in Hong Kong last year were to mainland parents. Residents are demanding a crackdown, and a hard look at the residency rights law.