Chinese lawmakers approved a proposal for sweeping new national security legislation in Hong Kong, defying a threat by U.S. President Donald Trump to respond strongly to a measure that democracy advocates say will curb essential freedoms in the city.

The National People’s Congress, China’s rubber-stamp legislature, approved the draft decision by a vote of 2,878-1 on Thursday at its annual session in Beijing, with six abstentions.

Chinese officials could now take months to sort out the details of laws banning subversion, secession, terrorism and foreign interference before they’re given to Hong Kong’s Beijing-backed administration to promulgate.

The move to bypass the semi-autonomous city’s local Legislative Council has alarmed Hong Kong’s pro-democracy activists and opposition politicians.

It risks spawning yet more protests in the city and could potentially prompt companies to flee if the laws undermine the independent judiciary in the Asian financial hub.

Chinese Premier Li Keqiang said shortly after the decision that the “one country, two systems” policy governing relations with the city would remain in place.

“The central government has all along fully and faithfully implemented” the system, he said at a briefing in Beijing at the end of the legislative session. The decision on national security laws would help “Hong Kong’s long-term stability and prosperity,” he added.

The Trump administration on Wednesday took the significant step of saying it could no longer certify Hong Kong’s autonomy from China, which was promised before the British handed the city back in 1997.

The move could trigger a range of actions by the Trump administration, from sanctions on Chinese officials to revoking the city’s special trading status with the U.S.

President Donald Trump, asked about the possible sanctions, said Tuesday his administration was “doing something now” that he would unveil this week.

“Hong Kong does not continue to warrant treatment under United States laws in the same manner as U.S. laws were applied to Hong Kong before July 1997,” Secretary of State Michael Pompeo said in announcing the decision.

“No reasonable person can assert today that Hong Kong maintains a high degree of autonomy from China, given facts on the ground.”

Other governments also expressed worries about the legislation. Japan said it was “seriously concerned” by the move, while Taiwan said it would release a plan to help Hong Kong residents if they wanted to leave the city.

The plan to enact the national security legislation was first announced in Beijing late last week, with Chinese officials saying it was needed to stem sometimes-violent protests that hit the city last year.

They argued that Hong Kong’s lawmakers had 23 years to pass the legislation, which is mandated under Hong Kong’s mini-constitution called the Basic Law.

Hong Kong’s main Hang Seng Index fell as much as 2.2% before closing 0.7% lower on Thursday.

‘Biggest Advantage’

Hong Kong leader Carrie Lam, who defended the legislation earlier this week, said in a statement Thursday that she welcomed the NPC’s approval.

“It will not affect the legitimate rights and freedoms enjoyed by Hong Kong residents,” she said. “‘One Country, Two Systems’ has been Hong Kong’s top advantage, and a stable and safe society will provide a favorable business and investment environment.

This will help better Hong Kong’s development down the road. I strongly believe that various sectors of society will lend their full support for the legislation.”

Hong Kong’s democracy camp isn’t convinced, however.

While last year’s protests all but stopped during the pandemic, demonstrators came out multiple times since the announcement on the laws, defying police who are still limiting public gatherings. Some of them chanted for independence, a clear red line that Beijing has used to justify passing the laws.

Jimmy Lai, a Hong Kong media tycoon and prominent pro-democracy activist, said the laws could push business away and eventually turn anyone who participates in a demonstration into a criminal.

“It’s like a knife on top of our head,” Lai told Bloomberg Television. “Anytime it will come to our neck.”

--With assistance from David Watkins, Natalie Lung and Jing Li.