China's President Xi Jinping and US President Donald Trump during a meeting outside the Great Hall of the People in Beijing.

Artyom Ivanov | TASS | Getty Images

China's Ministry of Foreign Affairs said Thursday the U.S. has "sinister intentions" and its "plot" is "doomed to fail," after President Donald Trump signed two bills supporting Hong Kong protesters into law.

State media also published a statement from the Hong Kong liaison office, emphasizing its commitment to defending its "one country, two systems" policy.

"We are officially telling the U.S. and the handful of opposition politicians in Hong Kong who follow America's lead to not underestimate our determination to protect Hong Kong's prosperity and stability, don't underestimate our belief to protect the 'one country, two systems policy' and don't underestimate our capabilities and strategies in protecting our country's sovereignty, safety, growth and rights," the office said, according to a CNBC translation of an online-Chinese language statement.

Hong Kong is a semi-autonomous territory which operates under the "one country, two systems" principle — a structure that grants the city's citizens some degree of financial and legal independence from the mainland.

In a statement released by the White House, Trump said, "I signed these bills out of respect for President Xi, China, 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,"

That statement, along with the one issued by the Ministry of Foreign Affairs, came just hours after Trump signed the Hong Kong Human Rights and Democracy Act of 2019 into law. He also signed another bill banning the sale of munitions like tear gas and rubber bullets to Hong Kong police.

"This so-called bill will only make the Chinese people, including our compatriots in Hong Kong, further understand the sinister intentions and hegemonic nature of the United States. It will only make the Chinese people more united and make the American plot doomed to fail," China's foreign ministry said in an online Chinese-language statement Thursday, according to a CNBC translation.

The ministry emphasized that Hong Kong is part of China through the "one country, two systems" policy, and that the special administration region's issues are internal affairs. It also said, "Hong Kong residents enjoy unprecedented level of democracy."

"The U.S. is creating a false reality, confusing right and wrong, publicly supporting crazy violent criminals in carrying out vandalism, violence against innocent citizens, and disruption to the city's peace," the foreign ministry said.

Hong Kong, a former British colony returned to Chinese rule in 1997, has been engulfed in months of anti-government protests. Initially sparked by a bill that would have enabled extradition to mainland China, the protests have morphed into broader anti-government demonstrations, including a wider range of demands such as greater democracy and universal suffrage.

The city's government also slammed the bills in an earlier statement.

The Hong Kong government "expressed strong opposition" to the bills becoming law and said it "extremely regrets the U.S. repeatedly ignoring Hong Kong's concern regarding the two bills," according to a CNBC translation.

"These two bills are an obvious intervention of Hong Kong's internal affairs, they are unnecessary and without grounds, they will also harm the relationship and interests between Hong Kong and the U.S.," the Hong Kong government said in a statement.

A Hong Kong government spokesman also said the bills will send the "wrong message" to protesters, "providing no help to ease Hong Kong's situation."

"We advise the U.S. not to act arbitrarily, or else China must firmly counteract, and the U.S. must bear all resulting consequences," China's foreign ministry said in its statement.

— CNBC's Vivian Kam contributed to this report.