British Prime Minister Boris Johnson on Wednesday said he would offer a path to U.K. citizenship for up to three million Hong Kongers, as China imposes a new national security law on the territory. The law broadens Beijing’s powers to investigate and prosecute criminals in Hong Kong, and criminalizes the acts of secession, subversion, terrorism, and collusion with foreign powers.

Johnson said the law “constitutes a clear and serious breach” of the Sino-British Joint Declaration, a treaty that laid out how the territory would be ruled after it was returned from the U.K. to China in 1997. The declaration guarantees Hong Kong with a high degree of autonomy from mainland China for at least 50 years under the “one country, two systems” formula, with the territory deemed a “Special Administrative Region.”

"It violates Hong Kong's high degree of autonomy and threatens the freedoms and rights protected by the joint declaration," Johnson said.

About 350,000 Hong Kongers who hold British National (Overseas) passports would be able to come to the U.K. for up to five years and would be granted a path to citizenship, along with 2.6 million other residents of the territory eligible for BN(O) passports. After five years of living in the U.K., these Hong Kongers would be able to apply for settled status. After having settled status for one year, they could then acquire U.K. citizenship. Holders of BN(O) passports previously would only have the right to visit the U.K. for up to six months as a visitor and had limited rights.

"We 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 UK, granting them limited leave to remain with the ability to live and work in the UK and thereafter to apply for citizenship. And that is precisely what we will do now," Johnson continued.

Hong Kong police on Wednesday made the first arrests under the new national security law. Hundreds of Hong Kongers had gathered in the busy Causaway Bay shopping district to protest the legislation, with riot police firing pepper spray and water cannons to disperse the crowd. Police arrested a man waving a black independence flag, along with a woman carrying a sign with the slogan “Hong Kong Independence."

According to police, at least 300 people were arrested on Wednesday, with nine of those individuals suspected of violating the new security law.

The law could infringe on the rights of Hong Kongers who are critical of the mainland. Under Hong Kong’s Basic Law, residents have constitutionally-protected civil liberties, such as the rights to freedom of expression and assembly, with these rights greatly curtailed in mainland China. Prior to the law being enacted, Joshua Wong, a popular pro-democracy activist, stepped down from the group he co-founded, Demosisto, due to fears of criminal charges. Beijing has called Wong a “black hand” colluding with foreign forces.

Jimmy Lai, a media mogul and prominent voice of the pro-democracy movement, called the legislation the “death knell for Hong Kong" in an interview with German broadcaster Deutsche Welle, and said he worries it will soon become “just another Chinese city.”

In addition to criticism from prominent figures in the U.K. and Hong Kong, Secretary of State Mike Pompeo has also slammed the legislation. Pompeo called the law “outrageous and an affront to all nations” in a State Department news briefing on Wednesday.

Hong Kong leader Carrie Lam defended the law on Tuesday in a video message to the United Nations Human Rights Council in Geneva. She said Hong Kong has been "traumatized by escalating violence fanned by external forces" and added that “no central government could turn a blind eye to such threats to sovereignty and national security."

In March, Hong Kong introduced a Fugitive Offenders bill, allowing the territory to extradite suspected criminals to China. The legislation drew criticism, as many Hong Kongers believe it would subject residents of the territory to unfair and impartial trials in mainland China.

In response to the bill, demonstrations erupted in Hong Kong, with protesters vandalizing pro-Beijing establishments and symbols in the territory. In September, Lam said she would withdraw the proposal, but Beijing has sought to tighten its grip over Hong Kong due to the unrest.