China on Thursday warned it would retaliate against the U.S. after President Trump Donald John TrumpFederal prosecutor speaks out, says Barr 'has brought shame' on Justice Dept. Former Pence aide: White House staffers discussed Trump refusing to leave office Progressive group buys domain name of Trump's No. 1 Supreme Court pick MORE signed legislation offering support for pro-democracy protesters in Hong Kong.

The Chinese Foreign Ministry threatened to take “firm counter measures” in response to the move and said the U.S. should consider the consequences of China’s retaliation if it continued to “act arbitrarily.”

Chinese Vice Foreign Minister Le Yucheng also summoned U.S. Ambassador to China Terry Branstad to demand that Washington stop meddling in Beijing's domestic affairs.

ADVERTISEMENT

"The Chinese government and people firmly oppose such stark hegemonic acts. We have made stern representations and strong protests to the US side," Chinese Foreign Ministry spokesman Geng Shuang said during a press conference.

The foreign ministry spokesman called the move "a severe interference in Hong Kong affairs" and "in serious violation of international law and basic norms governing international relations."

China is also reportedly mulling blocking drafters of the legislation, including Sen. Marco Rubio Marco Antonio RubioGOP lawmakers distance themselves from Trump comments on transfer of power McConnell pushes back on Trump: 'There will be an orderly transition' Graham vows GOP will accept election results after Trump comments MORE (R-Fla.), from entering mainland China as well as Hong Kong and Macau.

Rubio sent a tweet Thursday thanking Trump for signing the legislation.

The warnings from Beijing came less than a day after Trump signed the Hong Kong Human Rights and Democracy Act despite protests from officials in China.

“I signed these bills out of respect for President Xi, China, and the people of Hong Kong,” Trump said in a statement. “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.”

ADVERTISEMENT

Trump's signing of the legislation was met with cheers from pro-democracy protesters, thousands of whom staged a "Thanksgiving" rally on the territory to celebrate the bill's passage.

“I was confident Donald Trump would sign the law because we are fighting for universal freedom. Everyone globally should support that,” 25-year-old Jacky, who only gave his first name, told Reuters. “But we do want to give thanks to those around the globe that support us, a small city like Hong Kong, we thank them for their attention.”

The bill slaps levies on individuals who commit human rights violations in Hong Kong and prevents them from entering the U.S. It also requires the State Department to give an annual report to lawmakers on whether Hong Kong remains "sufficiently autonomous" from mainland China.

Beijing had called the bill “unnecessary and unwarranted” prior to its signing. The backlash over the bill marked the latest uptick in tensions between the U.S. and China, which have also been engaged in a long-running trade war.

Hong Kong has faced months of unrest as protesters have called for a litany of changes, including universal suffrage and an independent investigation into allegations of excessive use of force by police in dealing with protesters.

The protests began with pro-democracy demonstrations against an extradition bill. After the bill, which would have allowed for Hong Kong residents to be extradited to mainland China, was shelved, protests expanded to include several other demands as concerns grew that Beijing was looking to tighten its control over the territory.

Updated: 11:05 a.m.