In a signing statement released by the White House, Trump said the legislation "included a number of clearly unconstitutional provisions" in lawmakers' "haste" to pass it.
"While I favor tough measures to punish and deter aggressive and destabilizing behavior by Iran, North Korea and Russia, this legislation is significantly flawed," he said.
He went on, "My administration particularly expects the Congress to refrain from using this flawed bill to hinder our important work with European allies to resolve the conflict in Ukraine and from using it to hinder our efforts to address any unintended consequences it may have for American businesses, our friends or our allies."
Trump, however, said in another statement accompanying the bill that he would not allow the U.S. to "tolerate interference in our democratic process and that we will side with our allies and friends against Russian subversion and destabilization."
He said he signed the bill for "the sake of national unity" and hopes there will "be cooperation between our two countries on major global issues so that these sanctions will no longer be necessary."
The legislation, which also imposes sanctions on Iran and North Korea, was passed with rare and overwhelming bipartisan support in Congress last week.
The bill limits the president's ability to lift or waive sanctions against Russia and keeps in place sanctions the Obama administration imposed last year. It allows the U.S. to deny entry and revoke visas for individuals who have engaged in certain activities, such as selling arms to the Syrian government and abusing human rights.
Before Trump signed the bill, Secretary of State Rex Tillerson revealed that neither he nor Trump approved of the sanctions, arguing they would hinder the administration's attempts to restore relations with Russia.
"The action by the Congress to put these sanctions in place and the way they did — neither the president nor I were very happy about that," Tillerson told reporters Tuesday. "We were clear that we didn't think it was going to be helpful to our efforts."
Reporters asked press secretary Sarah Sanders about the president's decision to sign the bill, despite his previous protests, at Wednesday's White House press briefing. She said he made the decision in the interest of national unity.
"The president favors tough measures to deter and punish bad behavior of the regimes in Iran and North Korea and he sent a signal we will not tolerate interference in our democratic process by Russia," Sanders said.
As for the unorthodox move to issue two different statements in conjunction with the signing, Sanders indicated that one was "a legal document that goes with the executive secretary and the other one is a press document."
In response to the sanctions, Russia said the U.S. has until Sept. 1 to cut its diplomatic staff in the country by 755 people.