China approved a contentious national security law that will allow authorities to crack down on subversive and secessionist activity in Hong Kong, a move many see as Beijing's boldest yet to erase the legal firewall between the semi-autonomous territory and the mainland's authoritarian Communist Party system.
Chinese President Xi Jinping signed a presidential order on Tuesday promulgating the law after it was approved by the Standing Committee of the National Peoples Congress, the official Xinhua News Agency said.
It will be added to the Basic Law, Hong Kong's constitution.
Few details were given but China's liaison office in Hong Kong issued a statement warning opponents of the law not to underestimate the party centre's determination to safeguard Hong Kong's national security or its willingness and ability to enforce the new rules.
"We hope the law will serve as a deterrent to prevent people from stirring up trouble," said Tam Yiu-Chung, Hong Kong's sole representative on the Standing Committee.
"Don't let Hong Kong be used as a tool to split the country."
He said punishments would not include the death penalty, but did not elaborate on further details.
Passage of the law came amid fears in Hong Kong and abroad that it would be used to curb opposition voices in the Asian financial hub.
The US has already begun moves to end special trade terms given to Hong Kong after the former British colony was returned to China in 1997.
The legislation is aimed at curbing subversive, secessionist and terrorist activities, as well as foreign intervention in the city's affairs. It follows months of anti-government protests in Hong Kong last year that at times descended into violence.
Speaking in a video message to the UN Human Rights Council in Geneva, Hong Kong leader Carrie Lam said the law would only target an extremely small minority of lawbreakers, would not be retroactive, and that mainland legal bodies would only have jurisdiction in rare, specified situations.
Critics say it is the most significant erosion to date of Hong Kong's British-style rule of law and the high degree of autonomy that Beijing promised Hong Kong would enjoy at least through 2047 under a one country, two systems framework.
Hong Kong pro-democracy activists Joshua Wong, Agnes Chow and Nathan Law issued statements on Facebook saying they would withdraw from their organisation Demosisto, which then announced that it would disband with the loss of its top members.
Wong said worrying about life and safety has become a real issue and nobody will be able to predict the repercussions of the law, whether it is being extradited to China or facing long jail terms.
More than a hundred protesters gathered at a luxury mall in Hong Kong's central business district, chanting slogans including "Free Hong Kong, Revolution Now", with several holding up a flag representing an independent Hong Kong as well as posters condemning the law.
"The law's passage represents the greatest threat to human rights in the city's recent history," said Joshua Rosenzweig, head of Amnesty International's China Team.
"The speed and secrecy with which China has pushed through this legislation intensifies the fear that Beijing has calculatingly created a weapon of repression to be used against government critics, including people who are merely expressing their views or protesting peacefully," Rosenzweig said in a statement.
Concerns were also expressed in Taiwan, which Beijing claims as its own territory to be brought under its control by force if necessary.
"Democracy and freedom are shared universal values of Hong Kong and Taiwan," the island's Mainland Affairs Council said, adding that China had betrayed its promises to Hong Kong.
The self-governing island recently said it would consider providing asylum for Hong Kong opposition figures who fear arrest.
Ahead of the law's passage, the Trump administration said on Monday it will bar defence exports to Hong Kong and will soon require licenses for the sale of items that have both civilian and military uses.
"We cannot risk these items falling into the hands of the People's Liberation Army, whose primary purpose is to uphold the dictatorship of the (ruling Communist Party) by any means necessary," US State Secretary Mike Pompeo said in a statement.
British Foreign Secretary Dominic Raab said his government was deeply concerned over reports of the law's passage, saying that would be a grave step.
Britain has said it could offer residency and possible citizenship to about 3 million of Hong Kong's 7.5 million people.
“This issue is purely China's internal affairs, and no foreign country has the right to interfere,” Chinese foreign ministry spokesperson Zhao Lijian said.
He said China would take necessary measures to protect its national interests in response to the wrong acts of the United States.
Under the law, Beijing will set up a national security office in Hong Kong to collect and analyse intelligence and deal with criminal cases related to national security.
Government critics fear Beijing will use the law to pursue political opponents. Some have questioned the legal basis on which China proceeded with the legislation, saying it undermines the Basic Law.
An earlier attempt to pass a security law in 2003 was dropped after hundreds of thousands of people marched in Hong Kong's streets against it.
China for years had put off another such effort. Citing a new urgency after last year's protests, it announced it would bypass the Hong Kong legislature and enact the law on its own.
Chinese officials have railed against what they claim is foreign interference in the territory that they blame for encouraging the anti-government protests. Beijing condemned the protests as an attempt to permanently split Hong Kong away from China.
Drafting of the law took place amid intense secrecy, with even top Hong Kong officials reportedly not given advance notice of its specifics.
Questions linger over the effects on Hong Kong's free press that has come under increasing political and financial pressure, as well as the operations of non-governmental organisations, particularly those with foreign connections.
The law's passage comes after Hong Kong's legislature in early June approved a contentious bill making it illegal to insult the Chinese national anthem.
Pro-China figures have also been pushing for more patriotic education to be introduced into the curriculum, hoping that will boost their identification with Beijing.