WASHINGTON -- U.S. President Donald Trump on Wednesday signed two bills aimed at supporting human rights and pro-democracy activists in Hong Kong.

Trump signed the bills, which were approved by near unanimous consent in the House and Senate, even as he expressed some concerns about complicating the effort to work out a trade deal with China's President Xi Jinping.

"I signed these bills out of respect for President Xi, China, and the people of Hong Kong," Trump said in a statement. "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."

Congress approved the bills last week following months of unrest in the semi-autonomous Chinese city. Before Wednesday's signing announcement, Trump would only commit to giving the measures a "hard look."

China had threatened to take unspecified, "strong countermeasures" if the bills were signed into law.

The Hong Kong Human Rights and Democracy Act mandates sanctions on Chinese and Hong Kong officials who carry out human rights abuses and requires an annual review of the favourable trade status that Washington grants Hong Kong.

Another bill prohibits export to Hong Kong police of certain nonlethal munitions, including tear gas, pepper spray, rubber bullets, water cannons, stun guns and tasers.

The munitions bill was passed unanimously, while Republican Rep. Thomas Massie of Kentucky was the sole House member to oppose the human rights bill.

Trump acknowledged last week that he was weighing the ramifications of signing the bill.

"Look, we have to stand with Hong Kong," Trump said in an interview on "Fox & Friends." He continued: "But I'm also standing with President Xi. He's a friend of mine. He's an incredible guy."

Democratic and Republican lawmakers applauded the signing of the bills. Sen. Robert Menendez, D-N.J., said it "finally sends a clear and unequivocal message to the people of Hong Kong: We are with you."

Sen. Jim Risch, an Idaho Republican and chairman of the Senate Foreign Relations Committee, said the bills are "an important step forward in holding the Chinese Communist Party accountable for its erosion of Hong Kong's autonomy and its repression of fundamental human rights."

Rep. Chris Smith, R-N.J., who sponsored the House human rights bill, said Xi "should understand that the U.S. is not kidding about human rights. Beating, torturing and jailing of democracy activists is wrong and this historic legislation lets China know that respecting fundamental human rights is paramount."

Activists hailed Trump's action.

"I know that many people in Hong Kong are happy that the U.S. government has passed a new bill," said Figo Chan, a 23-year-old Hong Kong protester who was honoured with the John McCain Prize for Leadership at the Halifax International Security Forum in Canada last weekend.

"No one wants to die and no one wants to be hurt," Chan said. "I hope that citizens of many different countries can in their own way fight for democracy."

----

Associated Press writer Rob Gillies contributed to this report from Toronto.