United States President Donald Trump signed a legislation that supports the pro-democracy protestors in Hong Kong, BBC reported on Thursday. The Human Rights and Democracy Act mandates a yearly review to see if Hong Kong has enough autonomy for its special status with the United States.

“Hong Kong is part of China but has a largely separate legal and economic system,” the bill says. “The [annual review] shall assess whether China has eroded Hong Kong’s civil liberties and rule of law as protected by Hong Kong’s Basic Law.”

The legislation also provides for the president to impose sanctions and curbs on travel on those found responsible for arbitrary detention, forced confession and torture or any other human rights violation of any Hong Kong resident, CNN reported.

The newly signed law also said that the US should allow Hong Kong residents to get visas even if they were arrested for being part of non-violent agitations.

“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,” a statement from Trump said. “My administration will treat each of the provisions of the Act consistently with the President’s constitutional authorities with respect to foreign relations.” He said the bill was being enacted with the hope that leaders in China and Hong Kong will settle their disputes amicably.

Hong Kong’s special trading status meant that it will not be affected by US-imposed sanctions. Another bill was signed that banned the export of mob-control munitions to the Hong Kong police, including rubber bullets and stun guns.

While Trump claimed the law was introduced “out of respect for President Xi [Jinping], China, and the people of Hong Kong”, Beijing has threatened action. The Chinese foreign ministry on Thursday said it will take “firm counter measures” if the US continued to interfere in Hong Kong, Reuters reported.

It described the new law as a serious interference in Chinese matters, and said that United States’ efforts were “doomed to fail”. Beijing also cautioned that the US would have to take onus for the consequences after China’s counter measures.

Trump had, in the past, not voiced his complete support for the legislation, which was introduced in June when the protests began. However, the bill had strong congressional support that meant even if he had vetoed it, legislators could have voted to reverse his decision.

On November 23, Trump claimed Hong Kong would have been “obliterated” had he not told the Chinese president that sending troops into the semi-autonomous territory would have a “tremendous negative impact” on negotiations to end the two countries’ 16-month old trade war.

Pro-democracy protests in Hong Kong

The Hong Kong protests had initially been organised to oppose an extradition bill that proposed to allow criminal suspects to be sent to mainland China for trial. However, they soon evolved into a pro-democracy backlash against the city’s government and its political masters in Beijing.

On October 23, the Hong Kong administration, led by Lam, formally withdrew the extradition bill. However, the administration accepted just one of the pro-democracy protestors’ demands. The protestors have demanded that Lam step down from her post, an inquiry into the alleged police brutality during the protests, retraction of the word “riots” to describe the demonstrations, amnesty for all those arrested for protesting, and universal suffrage.

Earlier this week, the pro-democracy camp won a landslide majority in the district council elections held on Sunday that saw a record turnout. The polls – the first after protests began five months ago – were held for the post of 452 district councillors, and was a litmus test for the current regime as the pro-Beijing parties held a majority of the seats.

Following the results, Hong Kong’s leader Carrie Lam said in a statement that the administration respected the results. She said that analysis of the results claim that it reflects the general population’s dissatisfaction with the prevailing situation and the “deep-seated problems in [the] society”.