Donald Trump has unexpectedly signed into law two bills pledging support for Hong Kong’s protest movement, prompting a furious reaction from China.

The bills were passed with almost unanimous consent in both the House of Representatives and Senate last week, but the president had only previously committed to giving a “hard look” at what was on the table.

Now enshrined in law, they commit the US to conduct an annual review into the state of Hong Kong’s autonomy from mainland China.

If Beijing is found to have eroded the city’s independence, Hong Kong will risk losing its special status as a US trading partner, and the favourable tariffs that go with it. In practice, it would threaten the city’s position as a global financial hub.

The bills also ban US exports of rubber bullets, teargas and other crowd-control equipment to Hong Kong, following accusations that the police have put such measures to excessive use during the city’s six-month protest crisis.

And they impose sanctions on any individuals in both the mainland Chinese and Hong Kong governments who are found to be involved in human rights abuses towards the pro-democracy movement.

Mr Trump said he signed the bills late on Wednesday “out of respect for President Xi [Jinping], China, and the people of Hong Kong ... in the hope that [the] leaders and representatives of China and Hong Kong will be able to amicably settle their differences leading to long term peace and prosperity for all”.

China condemned the move and threatened that unspecified “consequences ... will have to be borne by the US side”. Beijing summoned the US ambassador on Thursday afternoon, urging the American government not to apply the new law.

In a statement, the ministry of foreign affairs called it “pure interference in China’s internal affairs” and a move “full of prejudice and arrogance ... extremely evil in nature and dangerous in motive”.

“The US side ignored facts, turned black to white, and blatantly gave encouragement to violent criminals who smashed and burnt, harmed innocent city residents, trampled on the rule of law and endangered social order,” the statement said.

Hong Kong’s government said it feared the legislation would damage relations with the US while sending the wrong signal to protesters. Carrie Lam’s administration said it “strongly opposes and regrets” the new laws.

Meanwhile in Hong Kong itself, police finally moved into the campus of the Hong Kong Polytechnic University (PolyU), the scene of a brutal 11-day siege between officers and a hardcore group of protesters attempting to avoid arrest.

Police began clearing the university after its administration said it believed no one else remained inside, following a two-day search that ended on Wednesday.

Hong Kong protests: Latest after court strikes down face mask ban Show all 24 1 /24 Hong Kong protests: Latest after court strikes down face mask ban Hong Kong protests: Latest after court strikes down face mask ban Police in riot gear move through a cloud of smoke as they detain a protester at the Hong Kong Polytechnic University AP Hong Kong protests: Latest after court strikes down face mask ban A protester takes cover under an umbrella Reuters Hong Kong protests: Latest after court strikes down face mask ban A protestor reacts to police officers EPA Hong Kong protests: Latest after court strikes down face mask ban Pro-democracy protesters react after the police fired tear gas outside the Hong Kong Polytechnic University EPA Hong Kong protests: Latest after court strikes down face mask ban A pro-democracy protester holds a placard EPA Hong Kong protests: Latest after court strikes down face mask ban Protesters react as police fire tear gas AFP via Getty Hong Kong protests: Latest after court strikes down face mask ban An anti-government protester is silhouetted during protests Reuters Hong Kong protests: Latest after court strikes down face mask ban Tear gas engulf umbrellas Reuters Hong Kong protests: Latest after court strikes down face mask ban A protester lowers himself down a rope from a bridge to a highway, to escape AFP via Getty Hong Kong protests: Latest after court strikes down face mask ban People form a human chain to pass materials as they gather for a march towards Hong Kong Polytechnic University AFP via Getty Hong Kong protests: Latest after court strikes down face mask ban Protesters are seen after leaving the campus of the Hong Kong Polytechnic University Reuters Hong Kong protests: Latest after court strikes down face mask ban Pro-democracy protesters during clashes with police outside the Hong Kong Polytechnic University EPA Hong Kong protests: Latest after court strikes down face mask ban Police spray blue-dyed liquid AP Hong Kong protests: Latest after court strikes down face mask ban Protesters are sprayed with blue liquid from water cannon during clashes with police outside Hong Kong Polytechnic University (PolyU) in Hong Kong, China, November 17, 2019. REUTERS/Tyrone Siu TYRONE SIU Reuters Hong Kong protests: Latest after court strikes down face mask ban Police officers detain a protester AP Hong Kong protests: Latest after court strikes down face mask ban An injured protester is evacuated by ambulance EPA Hong Kong protests: Latest after court strikes down face mask ban Injured people are taken away after clashes Getty Hong Kong protests: Latest after court strikes down face mask ban A protester throws back a tear gas canister fired by police at the Hong Kong Polytechnic University in Hong Kong on November 17, 2019. - Hong Kong police fired tear gas on November 17 morning at protesters intent on keeping their stranglehold on a major tunnel as pro-democracy activists vowed to "squeeze the economy" into next week. (Photo by Ye Aung Thu / AFP) (Photo by YE AUNG THU/AFP via Getty Images) YE AUNG THU AFP via Getty Hong Kong protests: Latest after court strikes down face mask ban Police arrest anti-government protesters Getty Hong Kong protests: Latest after court strikes down face mask ban A protester's umbrella is seen on fire during clashes with police outside Hong Kong Polytechnic University (PolyU) in Hong Kong, China November 17, 2019. REUTERS/Athit Perawongmetha ATHIT PERAWONGMETHA Reuters Hong Kong protests: Latest after court strikes down face mask ban Medical staff carry a protester out of the campus of Hong Kong Polytechnic University Reuters Hong Kong protests: Latest after court strikes down face mask ban Protesters try to extinguish a tear gas canister Reuters Hong Kong protests: Latest after court strikes down face mask ban Protesters take a rope down from a bridge to a highway, to escape from Hong Kong Polytechnic University campus AFP via Getty Hong Kong protests: Latest after court strikes down face mask ban A protestor gestures during a confrontation with police AP

Hours before the police operation, a masked protester came out from hiding and told reporters there were fewer than 20 others still holed up inside. They had avoided the university management searches, he said, because they could “never trust the police”.

A senior police official, Chow Yat Ming, said the focus of the operation was not to arrest any holdouts, but to remove caches of petrol bombs and other hazardous items reported by university management, and to gather evidence of “malicious” damage to campus facilities.

Any remaining protesters found by the police would be encouraged to seek medical attention, he said, and not arrested – though their details would be taken and they could face further action in future.

A spike in arrests during the PolyU clashes means more than 5,000 protesters have now been detained during the crisis, sparked in April by the government’s attempt to bring in legislation making it easier to extradite criminal suspects to the mainland.