The package of financial sanctions against Russia was signed by Trump behind closed doors and away from cameras on Wednesday, several White House sources said.
Read more: Trump-Putin relations: What's the next move?
The measures, designed to punish Russia's government for alleged meddling in the 2016 presidential election and annexing the Crimea peninsula from Ukraine among other things, had previously passed through Congress with overwhelming support.
Shortly after signing the bill, Trump issued a statement saying it remained "seriously flawed" and hindered his ability to negotiate.
"By limiting the Executive's flexibility, this bill makes it harder for the United States to strike good deals for the American people, and will drive China, Russia and North Korea much closer together," Trump said, adding that he signed "for the sake of national unity."
The bill, which also included increased sanctions against Iran and North Korea, had enough support in Congress to override a presidential veto.
Read more: US tells North Korea: 'We are not your enemy'
In relation to Russia, it mainly targets the country's energy sector. It includes a provision making it more difficult for the US president to remove sanctions against Russia. That is viewed as a sign of mistrust from the Republican-controlled Congress, as Trump has long made his desire for improved relations with Moscow clear.
Russian Prime Minister Dmitry Medvedev said the sanctions ended any hope of improved relations with the US. In a Facebook post, Medvedev claimed "Trump's administration has demonstrated total impotence by surrendering its executive authority to Congress in the most humiliating way," before adding that the measures amounted to an "all-out trade war against Russia."
In a preemptive response to the bill coming into law, Russia ordered the US to reduce the number of its diplomats in the country. It also shut down a recreational compound used by the US embassy on the outskirts of Moscow.
A special prosecutor is investigating whether Trump campaign advisers colluded with Russia ahead of the 2016 presidential election. The US president has denied collusion by his campaign.
Read: Trump admits input in son's misleading Russia statement
In his statement, Trump said his administration had worked with Congress to make changes to the bill including incorporating feedback from European allies who had been concerned the sanctions could impact German, Austrian or other European companies involved in the Russian Nord Stream 2 gas pipeline project.
Read more: New US Russia sanctions bill risks EU anger
European Commission President Jean-Claude Juncker on Wednesday told German broadcaster ARD that the US had taken some of the bloc's concerns into account. But, he reiterated the position that the EU was ready to take counter measures "within days" if the US sanctions harmed European companies.
The bill also placed bans on other countries considered a threat to global security. Iran is being targeted for its ballistic missile program, "destabilizing" activities in the Middle East and human rights abuses. Tehran has argued the sanctions go against the "letter and spirit" of the international nuclear accord signed by Iran and six world powers. The sanctions on North Korea target its nuclear weapons and ballistic missile programs as well as use of slave labor.
se/kms (AP, Reuters, AFP)