Russian President Vladimir Putin. (Akos Stiller/Bloomberg)

CONGRESS AT last looks ready to pass its first significant piece of legislation of the Trump administration — and it will be a major rebuke to the president. A sanctions bill covering Russia that the House is expected to take up Tuesday essentially would place President Trump’s policy toward the regime of Vladi­mir Putin in receivership, preventing him from lifting sanctions without congressional agreement. It’s a drastic but necessary response to the inexplicable affinity Mr. Trump has evinced toward the Kremlin, as well as to the continuing questions about Russia’s support for his presidential campaign.

The need for congressional action was underlined again on Sunday, when Mr. Trump’s new communications chief, Anthony Scaramucci, quoted the president as saying about Russia’s interference in the election, “Maybe they did it, maybe they didn’t do it.” For the U.S. intelligence community, there is no such doubt: Moscow did intervene with the intent to help Mr. Trump defeat Hillary Clinton, on the orders of Mr. Putin. Mr. Trump’s refusal to accept those conclusions, and the possibility that he might reverse sanctions imposed on Russia for that interference and for its military invasion of Ukraine, has generated an extraordinary consensus in an otherwise polarized Congress.

The Senate voted 97 to 2 to expand and codify the sanctions and to give Congress the power to block their suspension by the White House. Following an agreement struck over the weekend, the House is expected to approve a slightly altered version of the measure by a similar veto-proof margin.

New sanctions against Iran’s missile program and North Korean shipping are part of the bill, but the real impact will be on Russia policy. If Mr. Trump wishes to return two compounds confiscated from Russia by the Obama administration, which said they were used for spying, or to ease strictures on individuals and companies for their involvement in the Ukraine invasion, he will have to send Congress a report certifying that Russia has taken steps to stop its cyberaggression or that it has stopped trying to undermine Ukraine’s sovereignty. Congress would then have the opportunity to pass a resolution blocking the action.

The measure is a blunt one and could have some unintended consequences. U.S. and European policy on Ukraine has been based on offering Russia an easing of sanctions if it complied with a 2015 peace plan. If Mr. Putin now concludes that he has no chance of reaping that reward, he could escalate the still-simmering conflict in Ukraine’s eastern provinces. European Union officials, for their part, are alarmed by provisions of the bill allowing for sanctions on companies that partner with Russia in building pipelines to export its gas and oil, and are threatening retaliation. One way or another, U.S.-European coordination on Russia may become more difficult.

Congress’s action is nevertheless essential. It has become all too evident that Mr. Trump cannot be trusted to protect vital U.S. interests against persistent Russian aggression. He has shown no interest in stopping Russian cyberattacks, including further assaults on the U.S. electoral system. He appears ready to hand Mr. Putin major concessions for nothing, from the return of the compounds to withdrawal of U.S. support for rebel forces in Syria. Why Mr. Trump pursues these actions remains a mystery. But Congress is right to limit the damage.