President Trump had previously been non-committal about whether he would sign the bill, saying he was “with” Hong Kong but also that President Xi was “an incredible guy”.
However, the bill had widespread congressional support, which meant that even if he vetoed it, lawmakers could potentially have voted to overturn his decision.
President Trump also signed a second bill, which bans the export of crowd-control munitions to the police in Hong Kong – including tear gas, rubber bullets and stun guns.
He said: “[The bills] 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.”
The bill was introduced in June in the early stages of the protests in Hong Kong, and was overwhelmingly approved by the House of Representatives last month.
It says: “Hong Kong is part of China but has a largely separate legal and economic system.
“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.”
Among other things, Hong Kong’s special trading status means it is not affected by US sanctions or tariffs placed on the mainland.
The bill also says the US should allow Hong Kong residents to obtain US visas, even if they have been arrested for being part of non-violent protests.
Hong Kong’s protests started in June against a proposed law to allow extradition to mainland China but it has since transformed into a larger pro-democracy movement.
The protests have also seen increasingly violent clashes, with police being attacked, and officers firing live bullets.
The last week elections saw a landslide victory for the pro-democracy movement, with 17 of the 18 councils now controlled by pro-democracy councilors.
Tear gas has been fired by Hong Kong riot police at an unauthorized protest held by tens of thousands of people to condemn an attack by armed masked men last week.
As a small group of protesters refused to disperse in the northern district of Yuen Long, police fired rubber bullets.
The protest took place where pro-democracy protesters had been attacked by suspected triad gang members.
Police have been accused of turning a blind eye and colluding with the attackers, claims they deny.
There were seven weeks of anti-government and pro-democracy protests in Hong Kong sparked by a controversial bill that would have enabled extraditions to mainland China.
The government has since halted the legislation but protesters have demanded its complete withdrawal, as well as an inquiry into police violence, democratic reform, and that Hong Kong’s leader Carrie Lam resign.
The July 27 rally had been banned by the police, a highly unusual move in the territory, where protests are usually allowed.
Police say they refused permission because they feared violent clashes between protesters and residents.
The march was planned as a response to last Sunday’s attack, in which about 100 men descended on Yuen Long’s metro station, beating protesters – as well as passersby and journalists – with wooden and metal sticks.
The attack left 45 people injured and was widely blamed on triad gang members. They appeared to target those wearing black, the color people had been told to wear for the protest.
Triads are known to be active in Yuen Long – located in a rural northern district in Hong Kong, near mainland China – and many local villagers have also expressed opposition to the pro-democracy protests.
Tens of thousands defied the police ban and approached Yuen Long on July 27, marching down some of the main roads.
Police observed and filmed the start of the protest, and riot police could be seen on standby.
They said some protesters were holding iron poles and shields, and “even removing fences from roads”.
Some protesters also surrounded and vandalized a police vehicle, “causing danger to the life of the police officers on board”, they said.
Shortly after 17:00 local time, police began firing several rounds of tear gas in an attempt to disperse the crowd.
The protesters – most wearing masks and hard hats – threw projectiles and swore at police – but also parted to allow ambulances to go through.
Later in the evening, in an attempt to clear several hundred demonstrators, police fired rubber bullets, injuring at least nine people, according to the AFP news agency.
Protesters have been demanding an independent inquiry into police violence, saying police used excessive force in several anti-extradition bill and pro-democracy protests.
Demonstrators and pro-democracy legislators have alleged that the authorities – including the police and pro-government legislators – had advance knowledge of the attack.
Police say suggestions that they colluded with criminal gangs were a “smear”, and that 12 people have so far been arrested, including nine men with links to triads.
There have also been growing tensions between protesters and pro-Beijing groups.
Earlier this week, pro-Beijing legislator Junius Ho’s office was ransacked, and his parents’ graves were vandalized.
Junius Ho had come under criticism after video footage showed him shaking hands with white-shirted men on July 27 shortly before the attacks.
He said he did not know about the attack, but defended the men, saying they were simply “defending their home and people”.
In a brief speech on the tarmac, President Xi said Hong Kong was “always in my heart”.
Beijing’s central government “has always been a strong backer of Hong Kong” and “will, as always, support Hong Kong’s economic development and improvement of people’s lives”.
President Xi also said Beijing was “willing to work with all sectors of Hong Kong’s society in maintaining Hong Kong’s extraordinary journey these past 20 years”, and would “ensure ‘one country, two systems’ will continue with stability”.
Hong Kong was handed back from British to Chinese rule in 1997.
Beijing agreed to govern it under “one country, two systems”, granting the city its own legal system, limited democracy with multiple political parties, and rights like freedom of assembly and free speech.
However, China’s growing influence has been met with unease and concerns that the mainland could undermine Hong Kong’s more politically liberal traditions.
Activists have been campaigning for years for Hong Kong to have more political freedom.