Updated

The House overwhelmingly passed legislation on Tuesday that punishes Russia for its election meddling while also keeping President Trump from easing the penalties without congressional approval.

Lawmakers voted 419-3 to approve the bill, which also includes sanctions against Iran and North Korea.

“The multitude of threats posed to our national security by Iran, Russia, and North Korea cannot be understated," House Speaker Paul Ryan said after the vote. "These bad actors have long sought to undermine the United States and disrupt global stability."

The three lawmakers to vote no were all Republicans: Michigan Rep. Justin Amash, Tennessee Rep. Jimmy Duncan and Kentucky Rep. Thomas Massie.

The House and Senate bills are not quite in alignment, with North Korea’s inclusion in the measure. This would have to be resolved in both bodies before it goes to the president.

The sanctions targeting Russia, however, have drawn the most attention due to the president’s persistent push for warmer relations with President Vladimir Putin and ongoing investigations into Russia's interference in the 2016 campaign.

The White House had objected to a key section of the bill that would mandate a congressional review if Trump attempted to ease or end the sanctions against Moscow. But lawmakers from both parties opted to keep the sanctions review due to wariness over the relationship between Trump and Putin.

The Senate is expected to act soon on the legislation and the measure could be sent to Trump before Congress breaks for its August recess. Both chambers are positioned to approve the bill by veto-proof margins.

Trump hasn't threatened to reject the bill, but Secretary of State Rex Tillerson and other senior administration officials had objected to a mandated congressional review should the president attempt to ease or lift the sanctions on Russia. They've argued it would infringe on the president's executive authority and tie his hands as he explores avenues of communication and cooperation between the two former Cold War foes.

White House Press Secretary Sarah Sanders said Monday that Trump is "going to study that legislation and see what the final product looks like."

"The president very much supports sanctions on those countries but at the same time wants to be sure we get good deals," she told reporters on Air Force One. "Those two things are very important."

Signing a bill that penalizes Russia in part for interfering in 2016 campaign would mark a significant shift for Trump. He's repeatedly cast doubt on the conclusion of U.S. intelligence agencies that Russia sought to tip the election in his favor. He's blasted as a "witch hunt" investigations into the extent of Russia's interference and whether the Trump campaign colluded with Moscow.

According to the bill, Trump is required to send Congress a report explaining why he wants to suspend or terminate a particular set of the sanctions on Russia. Lawmakers would then have 30 days to decide whether to allow the move or reject it.

The North Korea-related sanctions bar ships owned by the reclusive nation or by countries that refuse to comply with U.N. resolutions against Pyongyang from operating in American waters or docking at U.S. ports. Goods produced by North Korea's forced labor would be prohibited from entering the United States.

The sanctions package also imposes mandatory penalties on people involved in Iran's ballistic missile program and anyone who does business with them. The measure would apply terrorism sanctions to the country's Revolutionary Guards and enforce an arms embargo.

Fox News’ Chad Pergram and The Associated Press contributed to this report.