The House overwhelmingly voted to impose financial sanctions on Russia and to limit President Donald Trump's authority to lift them, a direct challenge to the president's attempts to develop closer relations with Moscow.

Just three Republicans – Reps. Justin Amash of Michigan, Thomas Massie of Kentucky and John Duncan of Tennessee -- voted against the bill, which passed 419 - 3 in an unusually bipartisan rebuke.

"This strong oversight is necessary. It is appropriate. After all, it is Congress that the Constitution empowers to regulate commerce with foreign nations," said House Foreign Affairs Committee Chairman Ed Royce, R-Calif.

Included in the legislation are financial sanctions aimed at punishing Russia for its interference in the 2016 U.S. presidential election, as well as sanctions on Iran and North Korea for their aggressive weapons development programs.

The House vote comes after similar legislation in the Senate, which passed 98-2 in June, with just Sens. Rand Paul, R-Ky., and Bernie Sanders, I-Vt. voting against it.

Initially, the bill hit procedural snags over concerns it violated a Constitutional requirement that revenue bills originate in the House. House Democrats complained the bill would block them from the ability to force votes to prevent Trump from lifting sanctions, and gas companies raised concerns that they would not be able to seek business with Russian companies.

The bill passed Tuesday reflects compromises to ensure any member of the minority or majority can force a vote on a resolution of disapproval on a presidential order to lift sanctions. It limits energy sanctions to Russian export pipelines and excludes U.S. shale, deepwater and Arctic projects with Russian ownership stakes of less than 33 percent.

The sanctions on Pyongyang are also new to the House bill, but Senate Foreign Relations Committee Chairman Bob Corker told reporters on Monday he expects any "minor details" to be easily worked out and for the revised bill to easily pass the Senate.

White House press secretary Sarah Huckabee Sanders on Monday refused to say whether Trump would sign the bill, walking back signals over the weekend that the president would not veto it.

She told reporters that the president "has been very vocal about his support for continuing sanctions on those three countries."

"He has no intention of getting rid of them, but he wants to make sure we get the best deal for the American people possible," Sanders said. "Congress does not have the best record on that … He's going to study that legislation and see what the final product looks like."