Sen. Bob Corker (R-Tenn.). (Paul Morigi/Getty Images)

The Senate overwhelmingly passed a bill Thursday that would step up sanctions against Iran and Russia, in the process delivering a rebuke to President Trump’s policies toward Russia and Europe with a veto-proof majority.

The measure, which senators passed by a vote of 98 to 2, includes new sanctions against Moscow over its continued involvement in the wars in Ukraine and Syria and for its alleged meddling in the 2016 U.S. presidential election.

Senators struck a deal this week to include the language stiffening measures against Russia’s intelligence, defense, energy, metals, mining and railway sectors in an underlying bill introducing new measures to punish Tehran for ballistic missile tests and the engagements of the country’s Islamic Revolution Guard Corps.

Critically, the Russia language also included provisions codifying all existing sanctions against Russia and giving Congress the power to block the president if he tries to scale back existing ones.

That includes preventing the president from giving the Kremlin control over two properties on U.S. soil that the government seized late last year, accusing Russia of using them for intelligence-gathering purposes, while expelling 35 Russian operatives from the country. The Washington Post has reported that the Trump administration was considering giving the compounds back to Russia.

On Thursday, the Senate added one more tacit criticism of Trump’s foreign policy to the bill: an amendment reaffirming the commitment of the United States to NATO and its mutual defense obligations to other countries in the alliance. The measure, drafted by Sen. Lindsey O. Graham (R-S.C.), stands in sharp contrast to the recent posture of Trump, who attended a NATO summit last month as part of his first foreign trip and did not reaffirm the United States’ commitment to NATO’s mutual defense pact in his remarks.

The amendment passed the Senate by a vote of 100 to zero.

The strong bipartisan vote for sanctions reflects lawmakers’ common frustration with aggressive activities by Iran and Russia. It also is unique because it is the first major piece of foreign policy legislation the Senate has considered this year to command so much support from both sides of the aisle.

The underlying bill outlining new sanctions against Iran came about after months of negotiations, much of it playing out between Senate Foreign Relations Committee Chairman Bob Corker (R-Tenn.), ranking Democrat Benjamin L. Cardin (Md.) and senior member Robert Menendez (D-N.J.). It took the better part of a year for senators to iron out their differences and produce a compromise bill.

Similarly, senators tussled over Russia sanctions for several months as lawmakers filed competing measures while others wondered whether Congress should be stepping ahead of a new president with unorthodox ideas about how to engage with Moscow.

Corker was one of those senators who wanted to give the administration a chance, but only to a point. Late last month, he said he would give Secretary of State Rex Tillerson one more chance to convince him that the administration was making enough progress in cooperating with Russia over Syria that it was worth holding back on sanctions.

Tillerson did not, and thus Corker declared himself ready to move ahead with a sanctions bill, entering final negotiations with Banking Committee Chairman Mike Crapo (R-Idaho) and ranking Democrat Sherrod Brown (Ohio); as well as Cardin and Menendez; Foreign Relations Committee members Jeanne Shaheen (D-N.H.) and Marco Rubio (R-Fla.); Armed Services Committee Chairman John McCain (R-Ariz.) and members Graham and Richard Blumenthal (D-Conn.); and others.

Senate Majority Leader Mitch McConnell (R-Ky.) and Minority Leader Charles E. Schumer (D-N.Y.) also were involved in the multiparty negotiations to draft Russia sanctions that could secure a commanding majority of the Senate. Tillerson warned Wednesday against passing anything that might tie the administration’s hands. But support for the bill is easily enough to overcome a presidential veto.

The House has yet to take up the legislation or attempt to draft similar sanctions on its own.