UK on Wednesday extended Hong Kong residents a broader path to citizenship in response to China’s sweeping new security law for the former UK territory.

Prime Minister Boris Johnson’s announcement represents the most direct international response to legislation that has been roundly condemned by Western allies.

It comes during a London review of its entire range of relations with Beijing that includes a reassessment of the role China’s Huawei is playing in the buildup of Britain’s 5G data network.

Addressing the parliament, PM Johnson said, “We stand for rules and obligations”.

“The enactment and deposition of this national security law constitutes a clear and serious breach of the Sino-British Joint Declaration”, Johnson further added.

On Wednesday, Hong Kong Chief Executive Carrie Lam hailed a sweeping national security law imposed by Beijing as the “most important development” since the city was handed back to China.

Johnson said London had warned Beijing that it would introduce a new route for those with British National Overseas status to move to the UK.

Foreign Secretary Dominic Raab said Britain’s offer also extended to dependents of those with BNO status but refused to be drawn about how many would apply.

Hong Kong was under UK jurisdiction until Britain handed it to China in 1997 with a guarantee that Beijing would preserve the city’s judicial and legislative autonomy for 50 years.

According to critics, the new law — passed by Beijing’s rubber-stamp parliament this week without its text being released to the public — tests the limits of the “One Country, Two Systems” principle that formally entered international law in 1984.

Raab said Hong Kongers with BNO status and their dependents would first have the right to work or study in Britain for five years.

They would then have the right to apply for settled status then possible citizenship.

Earlier on Tuesday, China passed a sweeping national security law for Hong Kong prohibiting acts of secession, subversion, terrorism and collusion with foreign forces to endanger national security.

The new suite of powers radically restructures the relationship between Beijing and Hong Kong, toppling the legal firewall that has existed between the city’s judiciary and the mainland’s party-controlled courts.

Lam also said in her speech that the law “will not undermine Hong Kong’s judicial independence and high degree of autonomy, and won’t affect the Hong Kong people’s freedoms and rights.”

The proposal, which has been condemned by the United States and Hong Kong pro-democracy figures as an assault on the city’s freedoms, was tabled on the opening day of the week-long National People’s Congress.

Johnson’s government also irritated the US administration in January by allowing the private Chinese telecoms group Huawei to unroll Britain’s speedy new data network.

(With inputs from agency)