U.S. President Donald Trump on Wednesday signed a bill in support of Hong Kong's pro-democracy protesters, immediately drawing a rebuke from China and very likely complicating ongoing trade talks.

The new law directs the State Department to conduct an annual review to determine whether Hong Kong has retained enough autonomy from China to continue its special trade treatment by the United States.

Any change in the status could be a blow to China, which has benefited from using the territory as a gateway to global financial markets. The legislation also imposes sanctions on individuals responsible for human rights violations in Hong Kong.

Trump, who on the same day approved another bill prohibiting the export of tear gas and certain other munitions to Hong Kong police, said in a statement that the bills were signed "out of respect" for both Chinese President Xi Jinping and the people of Hong Kong.

"They are being enacted in the hope that 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," he said.

(Police remain on alert against demonstrators in Hong Kong on Nov. 26, 2019, after pro-democracy candidates won big in district council elections.)

But China, which has strongly asserted that matters related to Hong Kong are "purely China's internal affairs" and threatened "strong countermeasures" if the law were enacted, lashed out at the United States within hours of Trump's signing.

The Chinese Foreign Ministry expressed strong opposition to the decision, calling it a "stark hegemonic act" that aims to destroy the prosperity and stability of Hong Kong as well as "the great rejuvenation of the Chinese nation."

"We urge the U.S. to not continue going down the wrong path, or China will take countermeasures, and the U.S. must bear all consequences," the ministry said in a statement.

In passing the bill, the United States overtly supports "violent criminals," the statement said, adding that "this so-called bill will only enable the Chinese people, including Hong Kong compatriots, to further understand the sinister intentions and hegemonic nature of the United States, and only make the Chinese people more united."

Foreign Ministry spokesman Geng Shuang remained vague on the details of the countermeasures, telling reporters, "Stay tuned. What will come, will come," at Thursday's regular press briefing.

Also in Beijing, Vice Foreign Minister Le Yucheng summoned U.S. Ambassador Terry Branstad to lodge a "strong protest" over the bill's signage, the Foreign Ministry said.

Yucheng was quoted urging the United States to "correct its mistakes and change its approach" by not putting the bill into effect so as not to cause greater damage to bilateral relations.

The Hong Kong and Macao Affairs Office of China's State Council "strongly condemned" the signing of the act, called it a "blatant interference in China's internal affairs and severe violation of international laws and the basic norms governing international relations," the office said in a statement.

"This so-called bill will only enable the Chinese people, including Hong Kong compatriots, to further understand the sinister intentions and hegemonic nature of the United States, and only make the Chinese people more united."

(Rally in Central on Nov. 28)

The Hong Kong government also expressed "strong opposition" to the laws signed by Trump, saying they are unnecessary and harmful to the relationship between Hong Kong and the United States.

Some of the provisions "are actually about export control and enforcement of the sanctions imposed by the United Nations in Hong Kong, which are totally unrelated to human rights and democracy," a Hong Kong government spokesman said in a statement.

The legislation, he said, "will also send an erroneous signal to protesters, which is not conducive to alleviating the situation in Hong Kong."

Trump signed the Hong Kong Human Rights and Democracy Act at the same time as the United States and China are working to finalize a partial trade deal in hopes of easing tensions stemming from their protracted trade war.

Trump has apparently been worried about the fate of the deal if he signed the bill.

But even if Trump had vetoed the bill, Congress would have been able to override it with a two-thirds vote in both chambers. The bill passed the Senate with unanimous consent and received support from an overwhelming majority in the House of Representatives.

The latest development came as concerns have been growing inside the United States over the deepening political unrest in Hong Kong and the violence seen in clashes between protesters and police forces.

(Rally in Central on Nov. 28)

The protests began in June over a now-withdrawn bill that sought to allow extraditions from Hong Kong to mainland China, but demonstrators have also been motivated by what they see as an erosion of the "high degree of autonomy" given to the territory.

Under China's "one country, two systems" policy, Hong Kong was promised it would enjoy the rights and freedoms of a semiautonomous region for 50 years following the former British colony's return to Chinese rule in 1997.

Also, in line with the framework, the United States, under its 1992 law, has given Hong Kong a special status separate from the rest of mainland China on matters including tariffs and visa issuance.

Hong Kong's economic openness and freedom of expression, among other issues, have made the territory attractive to businesses around the world, helping the region to flourish as an international financial hub. Hong Kong also plays a role as a fundraising conduit for Chinese firms.

Related coverage:

Hong Kong councilors-elect rally for release of campus protesters

Manga on Uyghur woman's testimony of torture in China goes viral

Pro-democracy parties secure landslide win in Hong Kong elections