China has summoned US ambassador Terry Branstad to "strongly protest" against US president Donald Trump's signing of bills on human rights in Hong Kong.
Mr Trump signed the bills, which were approved by near unanimous consent in the US house and senate, even as he expressed some concerns about complicating efforts to work out a trade deal with his Chinese counterpart Xi Jinping.
Chinese vice foreign minister Le Yucheng told Mr Branstad that the move constituted "serious interference in China's internal affairs and a serious violation of international law".
Mr Le called it a "nakedly hegemonic act". He urged the US to not implement the bill in order to prevent greater damage to US-Chinese relations.
China has repeatedly accused America and other Western countries of orchestrating the mass pro-democracy demonstrations that have roiled Hong Kong for six months.
In Hong Kong, police have begun clearing a university that was a flashpoint for clashes with anti-government demonstrators. The move into the Polytechnic University came after its administration said they believed no-one else remained inside.
Activist Joshua Wong hailed the passing of the US legislation and says he hopes it will spur other western nations to follow suit. Chinese government spokesman Geng Shuang said Mr Trump's move would undermine "cooperation in important areas".
The US laws mandate sanctions on Chinese and Hong Kong officials who carry out human rights abuses in Hong Kong; require an annual review of Hong Kong's favourable trade status; and prohibit the export to Hong Kong police of certain non-lethal munitions.
A ministry statement earlier on Thursday repeated heated condemnations of the laws and said China would take unspecified "counter-measures".
It said all people of Hong Kong and China oppose Washington's move.
It is unclear how China will respond exactly, and whether Mr Trump's decision might disrupt negotiations with Beijing aimed at easing trade tensions.
When asked if the US legislation would affect trade talks with Washington, a Chinese commerce ministry spokesman said he had no new information to share.
Recently, both sides expressed confidence they were making headway on a preliminary agreement to avert a further escalation in a tariff war that has hammered manufacturers in both nations.
Mr 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."
Echoing Beijing's complaints over foreign interference, CY Leung, a former chief executive of Hong Kong, said Thursday that he doubted the US or supporters of the bills in Hong Kong "ever had the interest of Hong Kong in mind".
He suggested Hong Kong was a "proxy" for China for the US in hitting back against Beijing.
Mr Leung, who struggled to quell weeks of pro-democracy demonstrations in 2014 during his own term in office, withheld comment on how well current Hong Kong leader Carrie Lam has handled the crisis.
But he suggested the protests would leave Hong Kong with fewer rather than more freedoms.