Washington (CNN) US President Donald Trump on Wednesday signed a law supporting Hong Kong's months-long protest movement , handing anti-government demonstrators in the semi-autonomous Chinese city a moral victory and likely complicating trade negotiations with Beijing.

The US has long maintained a special trading relationship with Hong Kong , a semi-autonomous territory where mass protests have erupted continuously since June over perceived infringement on its autonomy by Beijing, among a host of other issues.

The new law will require the US to annually confirm that Hong Kong's special freedoms are being maintained by Beijing -- failure to do so could result in Washington withdrawing the city's special status, a massive blow to the Hong Kong economy.

The bill also lays out a process for the President to impose sanctions and travel restrictions on those who are found to be knowingly responsible for arbitrary detention, torture and forced confession of any individual in Hong Kong, or other violations of internationally recognized human rights in the Asian financial hub.

However, the US President's statement also indicated the administration would only enforce parts of the measure -- as it interferes with the President's ability to conduct foreign policy.

"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," the White House said in a statement.

In a personal signing statement, Trump added that he had signed the bills "out of respect for President Xi (Jinping), 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."

Delicate time

In a forceful statement after the bill was passed, China's Ministry of Foreign Affairs (MOFA) said the law "seriously interferes in Hong Kong's affairs and China's domestic politics."

"It has seriously violated international law and basic rules of international relations," the statement added. "Such plainly bullying behavior is firmly opposed by the Chinese government and Chinese people."

The ministry accused the law of seeking to "destroy prosperity and stability in Hong Kong, the great practice of 'one country, two systems,' and the historical process of the great rejuvenation of the Chinese nation."

Separately, the Hong Kong government called the act "unnecessary and unwarranted" and said it "deeply regretted that the US has disregarded the genuine concerns raised repeatedly by Hong Kong."

"Although human rights and democracy are mentioned in the title of the Act, some of the provisions in the Act 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 in Hong Kong," a spokesman said.

Trump's announcement comes at a delicate time for US-China relations , as trade negotiators appeared to be edging closer to a trade deal between the US and China.

On Tuesday, Chinese Vice Premier Liu He and his US counterparts, Trade Representative Robert Lighthizer and Treasury Secretary Steve Mnuchin, spoke on the phone to discuss trade negotiations, according to China's Ministry of Commerce.

"Both sides discussed each other's core concerns and reached a consensus on how to resolve these issues. Both sides agreed to maintain communication on the remaining matters in (trade) talks regarding a phase one agreement," the Commerce Ministry statement read.