President Trump on Wednesday signed two bills meant to support human rights and pro-democracy activists in Hong Kong, drawing a furious response from Beijing's foreign ministry.

The bills were signed as Hong Kong continues to be gripped by turmoil amid widespread discontent over Chinese rule in the special administrative region. Chinese officials had hoped Trump would veto the bill and the president had expressed some concerns about complicating the effort to work out a trade deal with China's President Xi Jinping.

"Look, we have to stand with Hong Kong," Trump said in an interview on "Fox & Friends" last week, later adding: "But I'm also standing with President Xi. He's a friend of mine. He's an incredible guy."

The Hong Kong Human Rights and Democracy Act mandates sanctions on Chinese and Hong Kong officials who carry out human rights abuses and requires an annual review of the favorable trade status that Washington grants Hong Kong. The second bill prohibits export to Hong Kong police of certain nonlethal munitions, including tear gas, pepper spray, rubber bullets, water cannons, stun guns and tasers.

"The act reaffirms and amends the United States-Hong Kong Policy Act of 1992, specifies United States policy towards Hong Kong, and directs assessment of the political developments in Hong Kong,” Trump said in a statement.

He added: “Certain provisions of the Act would interfere with the exercise of the President's constitutional authority to state the foreign policy of the United States.  My administration will treat each of the provisions of the Act consistently with the president's constitutional authorities with respect to foreign relations.”

HELEN RALEIGH: US MUST STAND WITH HONG KONG FREEDOM FIGHTERS

The munitions bill was passed unanimously, while Rep. Thomas Massie, R-Ky., was the sole House member to oppose the human rights bill. Before Wednesday's signing announcement, Trump would only commit to giving the measures a "hard look."

Chinese Foreign Ministry spokesman Geng Shuang said earlier this month the act undermines both American and Chinese interests in Hong Kong.

“We urge the U.S. to grasp the situation, stop its wrongdoing before it's too late, prevent this act from becoming law [and] immediately stop interfering in Hong Kong affairs and China's internal affairs,” Geng said at the time, adding: "If the U.S. continues to make the wrong moves, China will be taking strong countermeasures for sure."

On Thursday, a foreign ministry statement described Trump's signing of the bills as a "hegemonic act," repeated heated condemnations of the law and vows that China would take "firm countermeasures." The statement also claimed that all the people of Hong Kong and China oppose the move, but did not specify how Beijing would respond.

Hong Kong kept its advantageous trading status with the U.S. upon its 1997 handover to China by the U.K., in recognition of Beijing’s pledge to allow it to retain its own laws, independent judiciary and civil and economic freedoms.

That independent status has come into question amid moves by Beijing to gradually strengthen its political control over the territory, helping spark months of increasingly violent protests.

HONG KONG PROTESTERS' FAMILIES FEAR UNIVERSITY SHOWDOWN COULD SPARK 'TIANANMEN 2.0'

Earlier in November, China’s legislature argued it had the sole right to interpret the validity of Hong Kong’s laws after the territory’s court struck down an order banning the wearing of masks at protests. Legal scholars described that as a power grab violating the governing framework known as “one country, two systems.”

With Hong Kong’s Beijing-backed government refusing to enter into dialogue or make concessions, the territory’s police force has been given broad powers to quell the protests. That has brought numerous complaints of excessive use of force and the abuse of detainees, along with a near-complete lack of accountability for officers.

In a September report, Amnesty International documented numerous cases where protesters had to be hospitalized for treatment of injuries inflicted while being arrested.

The signing of the act may prove harmful for the administration’s moves to ease tensions with China, but it was widely praised by both Democrat and Republican lawmakers.

"If America does not speak out for human rights in China because of commercial interests, we lose all moral authority to speak out elsewhere," House Speaker Nancy Pelosi, D-Calif., said in a statement. “This bicameral, bipartisan law reaffirms our nation’s commitment to democracy, human rights and the rule of law in the face of Beijing’s crackdown.  America is proud to stand with the people of Hong Kong on the side of freedom and justice.

“I am pleased that the President signed this legislation and look forward to its prompt enforcement.”

“The signing of this legislation into law ensures the United States finally sends a clear and unequivocal message to the people of Hong Kong: We are with you,” Sen. Bob Menendez, D-N.J., the ranking member of the Senate Foreign Relations Committee, said in a statement. “With the world standing witness to history as the people of Hong Kong risk it all in pursuit of their legitimate aspirations for autonomy and against the erosion of democracy, I am incredibly proud to support the people of Hong Kong with the tools in this powerful new law.”

Sen. Marco Rubio, R-Fla., added: I applaud President Trump for signing this critical legislation into law. The U.S. now has new and meaningful tools to deter further influence and interference from Beijing into Hong Kong’s internal affairs.”

CLICK HERE TO GET THE FOX NEWS APP

Senate Foreign Relations Committee Chairman Jim Risch, R-Idaho said the bills are "an important step forward in holding the Chinese Communist Party accountable for its erosion of Hong Kong's autonomy and its repression of fundamental human rights." Sen. Ben Sasse, R-Neb., warned Xi: "Americans despise tyrants and stand in solidarity with Hong Kong. The whole world has seen both the courage of Hong Kongers and the brutality of your Chinese Communist Party. As long as freedom-seekers fill the streets of Hong Kong, the American people will take their side."

Trump’s signing of the act comes just days after pro-democracy candidates in Hong Kong won 269 out of 452 seats in 18 district council races, while pro-Beijing forces, who previously held 73 percent of the seats, won only 30. Voters came out in droves with a 71 percent turnout -- up from 47 percent four years ago in the same elections, according to the Electoral Affairs Commission.

The Associated Press contributed to this report.