Prime Minister Boris Johnson’s government will allow almost three million Hong Kong citizens to move to the U.K., risking further escalating tensions with China after it enforced a sweeping security law on the former British colony.

Speaking in the House of Commons on Wednesday, Johnson said the new legislation contravenes the 1984 agreement between London and Beijing, which set out the “one country, two systems” approach to protect Hong Kong’s autonomy when it returned to Chinese control in 1997.

Under the U.K. plan, the status of British National (Overseas) passport holders will be upgraded to grant immigration rights beyond the current six-month limit. The passports are held by 350,000 people in Hong Kong, with a further 2.5 million eligible for them. China accused the U.K. of meddling in its internal affairs after the proposal was first put forward in May.

“The enactment and the imposition of this national security law consitutes a clear and serious breach of the Sino-British joint declaration,” Johnson said. “It violates Hong Kong’s high degree of autonomy and is in conflict with Hong Kong’s Basic Law.”

Johnson said that he’d made clear “that if China continued down this path we would introduce a new route for those with British National Overseas status to enter the U.K., granting them limited leave to remain, with the ability to live and work in the U.K. and thereafter to apply for citizenship — and that is is precisely what we will do now.”

The spat over passports is one of a series of flash-points in U.K.-China relations, which have deteriorated on issues ranging from the British response to pro-democracy protests in Hong Kong to the ongoing debate over whether Huawei Technologies Co. can retain a role in building the U.K.’s next-generation 5G telecommunications networks.

In an interview with Sky News in June, Foreign Secretary Dominic Raab said the U.K. would be prepared to sacrifice a post-Brexit free trade deal with China to protect Hong Kong citizens.

The U.K. is not alone in criticizing China’s new national security law, which came into force just ahead of the July 1 anniversary of Hong Kong’s return to Chinese rule, a symbolic occasion usually marked by mass protests against Beijing. U.S. Secretary of State Michael Pompeo said Hong Kong could no longer be considered sufficiently autonomous, and President Donald Trump is considering revoking some or all of its special trade privileges.

Meanwhile the G7 group of nations has said the law would jeopardize a system “which has allowed Hong Kong to become one of the world’s most prosperous regions.”

The national security law is aimed at punishing acts of secession, subversion of state power, terrorism and “collusion” with foreign and external forces. Separately, Hong Kong lawmakers passed legislation on June 4 that would punish anyone who shows disrespect for China’s national anthem — something that is already a crime in the mainland.

Hong Kong Chief Executive Carrie Lam, who is supported by Beijing, has defended the plan, insisting it has wide public support and the city’s freedoms would be preserved.