Photo/Illutration Chinese President Xi Jinping attends the closing session of China's National People's Congress (NPC) in Beijing on May 28. (AP Photo)

BEIJING--China’s ceremonial legislature overwhelmingly endorsed a national security law for Hong Kong on Thursday that has strained relations with the United States and Britain and triggered protests in the semi-autonomous territory.

The National People’s Congress backed the bill by a vote of 2,878 to 1 with 6 abstentions as it wrapped up an annual session that was held under intensive anti-coronavirus controls.

The move will ultimately change the territory’s mini-Constitution, or Basic Law, adding a national security law to be decided later by Chinese leaders. The standing committee of the National People’s Congress that handles most legislation will work out its details.

Activists in Hong Kong say the law will undermine civil liberties and might be used to suppress political activity.

The law and the way it is being enacted prompted U.S. Secretary of State Mike Pompeo to announce on Wednesday that Washington will no longer treat Hong Kong as autonomous from Beijing.

On Thursday, three pro-democracy lawmakers were ejected from Hong Kong’s legislative chamber during a debate over a bill that would criminalize insulting or abusing the Chinese national anthem.

At the United Nations, China blocked a U.N. Security Council meeting to discuss the legislation on Wednesday. Ambassador Zhang Jun said on Twitter that Hong Kong matters are “purely China’s internal affairs.”

Also Thursday, the legislature approved a government budget that will increase spending to generate jobs in an effort to reverse an economic slump after Chinese industries were shut down to fight the coronavirus pandemic.

The coronavirus pandemic added to strains for the ruling Communist Party that include anti-government protests in Hong Kong and a tariff war with Washington.

China has reported 83,000 virus cases with 4,634 deaths. It was the first country to shut down factories, shops and travel to fight the pandemic and the first to reopen in March, but is still struggling to revive economic activity.

Private sector analysts say as much as 30 percent of the urban workforce, or as many as 130 million people, have lost their jobs at least temporarily. They say as many as 25 million jobs might be lost for good this year.

Beijing will give local governments 2 trillion yuan ($280 billion or 30 trillion yen) to spend on meeting goals including creating 9 million new jobs, according to the budget. That is in line with expectations of higher spending but a fraction of the $1 trillion-plus stimulus packages launched or discussed by the United States, Japan and Europe.