China's parliament has backed security legislation for Hong Kong which would make it a crime to undermine Beijing's authority in the territory.
The resolution - which now passes to China's senior leadership - has caused deep concern among those who say it could end Hong Kong's unique status.
It could also see China installing its own security agencies in the region for the first time.
The move has already sparked a new wave of anti-mainland protest.
Hong Kong police confronted pro-democracy protesters on Wednesday. AFP
Clashes broke out on Wednesday as Hong Kong's parliament debated a different proposed law, which would make it a crime to disrespect the Chinese national anthem. Hundreds of people were arrested in protests over that and the security law.
Security remains high on Thursday, as a tense debate in the Legislative Council continues.
At least two pro-democracy legislators were ejected from the council on Thursday. One lawmaker, Ted Hui, threw rotten plants on to the floor of the chamber, saying it symbolised the decay of Hong Kong's political system.
"I want the speaker to feel what is meant by rotten," he said.
The speaker deemed the package to be an "unknown dangerous object", and called police and fire crews.
What has the reaction been?
Full details about exactly what behaviour will be outlawed under the new security law are not yet clear. It is due to be enacted before September.
But hours before the vote was taken in Beijing, US Secretary of State Mike Pompeo said developments in Hong Kong meant it could no longer be considered to have "a high degree of autonomy" from mainland China.
Firefighters check the Legislative Council chamber after a lawmaker threw foul-smelling plants on to the floor. EPA
That meant that Hong Kong no longer merited being treated differently from the mainland under US law.
The declaration could have major implications for Hong Kong's trade hub status and drew an angry reaction from Chinese authorities in the territory.
In a strongly worded statement on Thursday, the office of China's foreign ministry in Hong Kong said it "firmly opposed and refuted" Mr Pompeo's statement and urged the US to "immediately stop meddling" in China's internal affairs.
It described US criticism of the new draft law as "utterly imperious, unreasonable and shameless".
On Friday, UK Prime Minister Boris Johnson's spokesman said the UK was "deeply concerned" about the new security law, which "risks undermining the principle of 'one nations, two systems'".
Japan said it was "seriously concerned" by Beijing's move. Chief Cabinet Secretary Yoshihide Suga said Hong Kong was an "extremely important partner" and that democracy and stability there must be maintained.
What happens next?
The National People's Congress (NPC) - meeting in Beijing after a two-month delay caused by the coronavirus pandemic - backed the security bill resolution with 2,878 votes in favour, one against and six abstentions.
President Xi Jinping and other senior figures applauded when the security law was passed. AFP
"It will uphold and improve the 'one country, two systems' policy," NPC chairman Li Zhanshu told delegates during the closing ceremony.
"It is in line with the constitution and Hong Kong's Basic Law and is in the interest of all Chinese people including Hong Kong people," he added.
The NPC only ever approves legislation put to it by the government so there was no chance the bill would not be supported.
The legislation - referred to as the Draft Decision - now passes to the Standing Committee of the Communist Party which will draw up the full details of the new law.
It is expected to criminalise:
- secession - breaking away from the country
- subversion - undermining the power or authority of the central government
- terrorism - using violence or intimidation against people
- activities by foreign forces that interfere in Hong Kong
The resolution also says that "when needed, relevant national security organs of the Central People's Government will set up agencies in Hong Kong to fulfil relevant duties to safeguard national security in accordance with the law".
That means China could potentially have its own law enforcement agencies in Hong Kong, alongside the city's own.
The authorities in Hong Kong insist the law is essential to tackle growing violence and "terrorism", and that the territory's residents have nothing to fear from it.
Critics fear it could lead to Hong Kongers being prosecuted - even retroactively - for criticising their or the mainland's leadership, joining protests or exercising their current rights under local laws.
Why did China do this?
Hong Kong was handed back to China from British control in 1997, but under a unique agreement - a mini-constitution called the Basic Law and a so-called "one country, two systems" principle.
They are supposed to protect certain freedoms for Hong Kong: freedom of assembly and speech, an independent judiciary and some democratic rights - freedoms that no other part of mainland China has.
Under the same agreement, Hong Kong had to enact its own national security law - this was set out in Article 23 of the Basic Law.
But its unpopularity meant it has never been done - the government tried in 2003 but had to back down after protests.
Then, last year, protests over an extradition law turned violent and evolved into a broader anti-China and pro-democracy movement.
China is keen to avoid a repeat of that unrest.