WASHINGTON (Reuters) - The U.S. Senate voted nearly unanimously on Thursday for legislation to impose new sanctions on Russia and force President Donald Trump to get Congress’ approval before easing any existing sanctions on Russia.

In a move that could complicate U.S. President Donald Trump’s desire for warmer relations with Moscow, the Senate backed the measure by 98-2. Republican Senator Rand Paul and Bernie Sanders, an independent who caucuses with the Democrats, were the only two “no” votes.

The measure is intended to punish Russia for meddling in the 2016 U.S. election, its annexation of Ukraine’s Crimea region and support for Syria’s government in the six-year-long civil war.

If passed in the House of Representatives and signed into law by Trump, it would put into law sanctions previously established via former President Barack Obama’s executive orders, including some on Russian energy projects. The legislation also allows new sanctions on Russian mining, metals, shipping and railways and targets Russians guilty of conducting cyber attacks or supplying weapons to Syria’s government.

“The legislation sends a very, very strong signal to Russia, the nefarious activities they’ve been involved in,” Senator Bob Corker, the Republican chairman of the Senate Foreign Relations Committee, said as lawmakers debated the measure.

If the measure became law, it could complicate relations with some countries in Europe. Germany and Austria said the new punitive measures could expose European companies involved in projects in Russia to fines.

The legislation sets up a review process that would require Trump to get Congress’ approval before taking any action to ease, suspend or lift any sanctions on Russia.

Trump was especially effusive about Russian president Vladimir Putin during the 2016 U.S. election campaign, though his openness to closer ties to Moscow has tempered somewhat, with his administration on the defensive over investigations into Russian meddling in the election.

Putin dismissed the proposed sanctions, saying they reflected an internal political struggle in the United States, and that Washington’s policy of imposing sanctions on Moscow had always been to try to contain Russia.

The bill also includes new sanctions on Iran over its ballistic missile program and other activities not related to the international nuclear agreement reached with the United States and other world powers.

UNCERTAIN PATH IN HOUSE

To become law, the legislation must pass the House of Representatives and be signed by Trump. House aides said they expected the chamber would begin to debate the measure in coming weeks.

However, they could not predict if it would come up for a final vote before lawmakers leave Washington at the end of July for their summer recess.

National flags of Russia and the U.S. fly at Vnukovo International Airport in Moscow, Russia April 11, 2017. REUTERS/Maxim Shemetov

Senior aides told Reuters they expected some sanctions package would eventually pass, but they expected the measure would be changed in the House. The Trump administration has pushed back against the bill, and his fellow Republicans hold a commanding 238- to 193-seat majority in the chamber.

Secretary of State Rex Tillerson questioned the legislation on Wednesday, urging Congress to ensure that any sanctions package “allows the president to have the flexibility to adjust sanctions to meet the needs of what is always an evolving diplomatic situation.”

Previously, U.S. energy sanctions had only targeted Russia’s future high-tech energy projects, such as drilling for oil in the Arctic, fracking and offshore drilling. They blocked U.S. companies such as Exxon Mobil, where Tillerson was chairman, from investing in such projects.

The new bill would slap sanctions on companies in other countries looking to invest in those projects in the absence of U.S. companies, a practice known as backfilling.

Also included for the first time are discretionary measures the Trump administration could impose on investments by companies in Western countries on Russia energy export pipelines to Europe.

The Senate also voted overwhelmingly on Thursday to add provisions to the bill allowing the U.S. space agency NASA to continue using Russian-made rocket engines and the 100 senators voted unanimously for an amendment reaffirming the U.S. commitment to the NATO alliance.