Britain has stood by its offer to grant up to 3 million Hong Kong residents the right to live and work in the UK, following China's decision to impose a national security law in the territory.
Hong Kong police fired water cannon and tear gas and arrested more than 300 people as protesters took to the streets in defiance of the sweeping security legislation they say is aimed at snuffing out dissent.
As thousands of protesters gathered downtown for an annual rally marking the anniversary of the former British colony's handover to China in 1997, riot police used pepper spray and fired pellets as they made arrests after crowds spilled into the streets chanting "resist till the end" and "Hong Kong independence".
UK Prime Minister Boris Johnson said Britain would stand by its pledge to give British National Overseas (BNO) passport-holders in its former colony a path to British citizenship, allowing them to settle in the United Kingdom.
Almost 3 million Hong Kong residents are eligible for the passport. There were 349,881 holders of the passports as of February.
China reacted angrily to the move when it was first suggested in May.
"The enactment and imposition of this national security law constitute a clear and serious breach of the Sino-British Joint Declaration," Johnson told the UK parliament on Wednesday.
Foreign Secretary Dominic Raab said Britain had carefully assessed China's national security legislation since it was published late on Tuesday.
"It constitutes a clear violation of the autonomy of Hong Kong, and a direct threat to the freedoms of its people, and therefore I'm afraid to say it is a clear and serious violation of the Joint Declaration treaty between the United Kingdom and China," Raab told Reuters and the BBC.
The law punishes crimes of secession, subversion, terrorism and collusion with foreign forces with up to life in prison, and will have mainland security agencies operate in Hong Kong for the first time and allow for extradition to the mainland for trial.
China's parliament adopted the law in response to protests last year triggered by fears that authorities in Beijing were stifling the city's freedoms that had been guaranteed by a "one country, two systems" formula agreed when it returned to Chinese rule.
Police cited the law in confronting protesters.
"You are displaying flags or banners/chanting slogans/or conducting yourselves with an intent such as secession or subversion, which may constitute offences under the ... national security law," police said in a message displayed on a purple banner.
Authorities in Beijing and Hong Kong have repeatedly said the legislation is aimed at a few "troublemakers" and will not affect rights and freedoms, nor investor interests.
But critics fear it is aimed ending the pro-democracy opposition and will crush the freedoms that are seen as key to Hong Kong's success as a financial centre.
The British government said it would stand by its word and offer all those in Hong Kong with British National Overseas status a "bespoke" immigration route.
British Foreign Secretary Dominic Raab described Wednesday's protests as heartbreaking and reprimanded HSBC and other banks for supporting the new law, saying the rights of Hong Kong should not be sacrificed for bankers' bonuses.
Britain and Canada also updated their travel advice for Hong Kong, saying there was an increased risk of detention.
Hong Kong's autonomy was guaranteed under the "one country, two systems" agreement enshrined in the Sino-British Joint Declaration signed by then Chinese Premier Zhao Ziyang and British Prime Minister Margaret Thatcher.
Hong Kong was handed back to China on July 1, 1997, after more than 150 years of British rule - imposed after Britain defeated China in the First Opium War.