British Prime Minister Boris Johnson pledged Wednesday to overhaul immigration rules to grant almost 3 million Hong Kong residents a pathway to British citizenship, a response to Beijing’s move to impose a far-reaching security law here that many fear will dismantle the city’s political freedoms. Johnson’s vow comes as the United States, Canada, Australia and others face pressure from lawmakers and human rights groups to offer residency to Hong Kong people fleeing deteriorating political circumstances in the former British colony, which was promised a high degree of autonomy under the terms of its 1997 handover to China.

London’s move, which Johnson said he would implement when China formally enacts the security law, could emerge as among the most significant ramifications of Beijing’s effort to undercut Hong Kong’s freedoms and bring the city more closely under the Communist Party’s authoritarian rule. It would potentially grant British residency and working rights to up to 40 percent of Hong Kong’s population, raising the specter of a brain drain from the Asian financial center.