WASHINGTON (AP) -- President Donald Trump on Wednesday signed a bill imposing new sanctions on Russia, conceding under pressure from his own party that a warmer relationship with Moscow was not in the country's best interest.

The legislation is aimed at punishing Moscow for interfering in the 2016 presidential election and for its military aggression in Ukraine and Syria, where the Kremlin has backed President Bashar Assad. It also imposes financial sanctions against Iran and North Korea.

Moscow responded to a White House announcement last week that Trump intended to sign the bill, ordering a reduction in the number of U.S. diplomats in Russia.

The House overwhelmingly backed the bill, 419-3, and the Senate rapidly following their lead on a 98-2 vote. Those overwhelming margins guaranteed that Congress would be able to beat back any attempt by Trump to reject the measure.

Provisions backed by Republican and Democrats would handcuff Trump on the Russia sanctions resulted from lawmakers' worries that he may ease the financial hits without first securing concessions from Russian President Vladimir Putin.

Republicans refused to budge even after the White House complained that the "congressional review" infringed on Trump's executive authority.

Faced with the embarrassing possibility of being overruled by Trump's own party, the White House announced late Friday that he "approves the bill and intends to sign it."

The proposed measures target Russia's energy sector as part of legislation that prevents Trump from easing sanctions on Moscow without congressional approval. Two White House officials said that the president signed the bill Wednesday morning. The officials spoke on condition of anonymity because they were not authorized to speak publicly before the official statement.