President Donald Trump speaks during a lunch meeting with Senate Republicans to discuss healthcare at the White House in Washington, July 19, 2017.

U.S. President Donald Trump will sign legislation that imposes sanctions on Russia, the White House said on Friday, after Moscow ordered the United States to cut hundreds of diplomatic staff and said it would seize two U.S. diplomatic properties in retaliation for the bill.

The U.S. Senate had voted almost unanimously on Thursday to slap new sanctions on Russia, forcing Trump to choose between a tough position on Moscow and effectively dashing his stated hopes for warmer ties with the country or to veto the bill amid investigations in possible collusion between his campaign and Russia.

By signing the bill into law, Trump can not ease the sanctions against Russia unless he seeks congressional approval.

Moscow's retaliation, announced by the Foreign Ministry on Friday, had echoes of the Cold War. If confirmed that Russia's move would affect hundreds of staff at the U.S. embassy, it would far outweigh the Obama administration's expulsion of 35 Russians in December.

The legislation was in part a response to conclusions by U.S. intelligence agencies that Russia meddled in the 2016 U.S. presidential election, and to further punish Russia for its annexation of Crimea in 2014.

Late on Friday, the White House issued a statement saying Trump would sign the bill after reviewing the final version. The statement made no reference to Russia's retaliatory measures.

Russia had been threatening retaliation for weeks. Its response suggests it has set aside initial hopes of better ties with Washington under Trump, something the U.S. leader, before he was elected, had said he wanted to achieve.