President Trump will sign legislation imposing new sanctions on Russia, despite his administration's initial skepticism of the bill.

"President Donald J. Trump read early drafts of the bill and negotiated regarding critical elements of it," White House press secretary Sarah Sanders said in a Friday night statement. "He has now reviewed the final version and, based on its responsiveness to his negotiations, approves the bill and intends to sign it."

Trump's team had played coy in the run-up to the final passage of the bill in Congress, because the bill gives him far less discretion about how to implement the measures than most conventional sanctions packages. The bill punishes an array of aggressive Russian activities, including the interference in the 2016 elections that has consumed so much of the early months of Trump's presidency.

"For too long, the message to Vladimir Putin has been that Russia can invade its neighbors, threaten U.S. allies, intensify its cyber-attacks, and interfere with foreign elections with very little repercussion," Senate Armed Services Chairman John McCain, R-Ariz., said in June when the bill passed the upper chamber. "Unless and until Russia pays a price for its actions, these destabilizing activities will continue."

Trump's team was torn between opposition to the legislation, which could impede efforts to negotiate with the Russians in several arenas, and a reported recognition that vetoing the bill would be politically difficult. The legislation had overwhelming support in Congress, while Trump has been beset by accusations of being soft on Russia ever since he denied their responsibility for the 2016 cyberattacks against the Democratic Party.

"He's going to study that legislation and see what the final product looks like," Sanders told reporters on Monday.

Secretary of State Rex Tillerson is trying to negotiate an end to the crisis in Ukraine, where Russia has annexed Crimea and sent military forces to support a separatist movement in the eastern part of the country. He is also trying to broker ceasefires in Syria, where Russia has partnered with Iran to support Syrian President Bashar Assad while the United States leads a coalition to defeat the Islamic State in Syria.

"I would urge Congress to ensure any legislation allows the president to have the flexibility to adjust sanctions to meet the needs of what is always an evolving diplomatic situation," Tillerson told the House Foreign Affairs Committee in June.

Congress largely ignored those appeals, by putting strict conditions on whether Trump can decide not to implement the sanctions and the circumstances under which he could lift them after they are implemented. Some of the sanctions, however — particularly those targeting the Russian energy sector — give Trump the latitude that presidents customarily enjoy.

The final passage of the legislation Thursday evening triggered retaliatory measures from Russia, which ordered a reduction of the number of U.S. diplomats working in the country. Trump's decision to sign the bill sets the stage for a potentially difficult round of talks with Europe, and Germany in particular, due to concerns that the measures will impede European energy companies seeking to do business with Russia.

"Sanctions policies are neither a suitable nor an appropriate instrument for promoting national export interests and the domestic energy sector," German Foreign Minister Sigmar Gabriel said Friday.