President Trump signed the Hong Kong Human Rights and Democracy Act on Wednesday, reaffirming U.S. support for the city's autonomy after months of pro-democracy protests.

Why it matters: The bill, which was passed with overwhelming bipartisan support in both the Senate and the House, serves as a major rebuke of China at a time when Washington and Beijing are engaged in critical trade talks. China has warned that it will take retaliatory measures if the bill becomes law.

Between the lines: Even if Trump had declined to sign the bill, it would still likely have the two-thirds support in Congress necessary to override a veto. In a statement acknowledging the signing, Trump noted that certain aspects of the bill would "interfere" with his "constitutional authority to state the foreign policy of the United States."

"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."

— President Trump

The big picture: The majority of Hong Kong's districts flipped in favor of pro-democracy candidates this week amid record voter turnout and registration. Hong Kong leader Carrie Lam said her government would "listen" and "reflect" in light of the results, which follow months of protests that left many demonstrators and police injured.

"I applaud President Trump for signing this critical legislation into law. The U.S. now has new and meaningful tools to deter further influence and interference from Beijing into Hong Kong’s internal affairs. Following last weekend’s historic elections in Hong Kong that included record turnout, this new law could not be more timely in showing strong U.S. support for Hong Kongers’ long-cherished freedoms."

— Sen. Marco Rubio (R-Fla.) said in a statement Wednesday

Go deeper: Pro-democracy parties triumph in key Hong Kong elections