Five months after pro-democracy demonstrations began roiling Hong Kong, the U.S. is finally taking action to support the protesters. And China is not happy about it.

On Wednesday, the U.S. House of Representatives passed two bills aimed at protecting the human rights of protesters involved in Hong Kong’s pro-democracy movement. They’re now just one man’s signature away from becoming law; President Donald Trump reportedly intends to sign the legislation, given its overwhelming support in Congress, although he has not publicly confirmed this.

The “Hong Kong Human Rights and Democracy Act,” which passed 417 votes to one, would make Hong Kong’s special trading status with the U.S. contingent on Beijing preserving the city’s autonomy. The semi-autonomous city’s special status is key to its standing as a global financial hub, and losing it would be a major blow to its economy, which has already tipped into recession amid the ongoing unrest.

The U.S. currently treats Hong Kong, which has its own legal and political systems, differently from the Mainland on trade issues. Under the new law, the U.S. State Department would have to certify at least once a year that Hong Kong still retained enough autonomy from Beijing — a core concern for protesters — for its special trading consideration to continue.

The bill would also allow the U.S. to slap sanctions on officials deemed responsible for human rights violations in the city, while a second bill, passed unanimously Wednesday, would ban the export of tear gas, pepper spray, rubber bullets and stun guns to the Hong Kong police force.

Speaker Nancy Pelosi, a major advocate for the legislation, said it would send “an unmistakable message to the world that the United States stands in solidarity with freedom-loving people of Hong Kong, and… we fully support their fight for freedom.”

In Hong Kong, the vote was welcomed, with protesters reportedly chanting “Sign the bill, protect Hong Kong,” during a demonstration Thursday. But across the border on the Chinese Mainland, the legislation has been received with fury, with top officials and state-run media threatening retaliation if it becomes law.

Foreign Minister Wang Yi said the legislation “indulges violent criminals” who China blames for the unrest, and was designed to “muddle or even destroy Hong Kong.”

On Thursday, the Chinese Communist Party’s main mouthpiece, the People’s Daily, ran a front-page editorial describing the legislation as "a piece of waste paper" that was a "serious provocation against the entire Chinese people," and calling on Washington to “rein in the horse at the edge of the precipice.”

“If the U.S. side obstinately clings to its course, the Chinese side will inevitably adopt forceful measures to take resolute revenge, and all consequences will be borne by the United States,” read the editorial, while another, in the state-run tabloid Global Times said the legislation should be more appropriately named the "Support Hong Kong Violence Act."

However, amid fears that tensions over the bill could upset delicate trade talks between Beijing and Washington, China’s Commerce Ministry said Thursday that it would still try to reach a “phase one” trade deal with the U.S.

“This is in line with the interests of both China and the United States, and of the world,” spokesman Gao Feng told reporters.

While many U.S. politicians have called for their government to do more to support the protesters in Hong Kong, Trump has so far appeared reluctant to confront Beijing over the issue, prioritizing efforts to secure a trade deal instead. According to reports, he even assured Chinese President Xi Jinping during a private phone call in June that the U.S. would stay quiet on the issue as long as trade talks continued.

The legislation comes at a time of escalated tensions over Hong Kong, following a protracted standoff between riot police and hardline protesters at Hong Kong Polytechnic University that has became the most violent moment of the crisis so far.

Beijing is also facing renewed criticism from Britain after Simon Cheng, a former British consulate worker in Hong Kong, claimed Wednesday he was tortured during his 15-day detention by Chinese secret police in August. China, in turn, has blamed Britain, along with the U.S., for fomenting the protests.

The case has sparked calls in Britain for the UK government to implement its own sanctions over Chinese abuses.

“The UK Government must match the resolve that US lawmakers showed last night and begin immediately preparing targeted sanctions, while offering asylum to those seeking to escape the iron grip of dictatorship like Simon Cheng,” said David Alton, a member of the House of Lords and vice chair of the Westminster Friends of Hong Kong. ‘That is the least we can do, frankly."