It was clear days before he put pen to paper on Wednesday that U.S. President Donald Trump would sign the latest round of sanctions against Russia.

Both houses of Congress had voted overwhelmingly in favor of the legislation, and the White House signaled the president would write the measures into law. The Kremlin had even announced the ouster of hundreds of U.S. diplomatic staff from Russia in response.

The sanctions build on executive orders by former President Barack Obama in response to Russia’s actions in Ukraine and follow suspected Russian interference in U.S. presidential elections last year, something Moscow denies.

They codify Obama’s orders into law and forbid Trump from lifting any measures without the approval of Congress.

Though he put his name under it, Trump has called the act “flawed” because it limits “the executive’s flexibility” in dealing with Russia.

Who does it affect?

— Those found to be involved in “undermining cyber-security” against people or government or democratic institutions on behalf of Russia will have their assets frozen, visas canceled and be barred from entering the United States.

— The same goes for people judged to be complicit in human rights abuses on territory controlled by Russia.

— The sanctions bill demands that U.S. authorities investigate senior foreign political figures and oligarchs in Russia, their wealth and their links to corruption and to President Vladimir Putin, as well as examine the impact of imposing secondary sanctions on oligarchs.

— The U.S. Treasury will also prepare a report into the effects of expanding financial sanctions, currently imposed on several companies and state entities, to include Russian sovereign debt and other derivatives.

— Sanctions will also be imposed against entities that do business with Russian military or intelligence agencies.

— The bill says the United States will “continue to oppose” the Nord Stream 2 pipeline project, which aims to deliver gas to Western Europe under the Baltic Sea, bypassing Ukraine.

Washington will impose sanctions against any person who “sells, leases, or provides … goods, services, technology, information, or support,” to Russia to build energy export pipelines. But it will do these “in coordination with allies,” likely limiting the impact on European companies involved in pipeline projects.

What’s next?

If history is any guide, the sanctions will be difficult to lift even if U.S.-Russian relations improve.

The previous U.S. sanctions legislation against Moscow, the 1974 Jackson-Vanik Amendment, which restricted trade with the Soviet Union, was repealed only in 2012, two decades after the end of Communism.

Ironically, Jackson-Vanik was removed as part of the Magnitsky Act, which imposed sanctions against Russian human rights violators and sent U.S.-Russia relations to a new low.