The president has sent mixed messages about what comes next. Aides initially signaled that Mr. Trump would have no choice but to allow the bill to become law. On Thursday, however, his new communications director, Anthony Scaramucci, suggested that Mr. Trump could veto the bill, ostensibly as a prelude to pushing for “tougher” legislation. As Minority Leader Chuck Schumer said aptly on the Senate floor, however, “I’m a New Yorker, too, and I know bull when I hear it.” Alternatively, if Mr. Trump vetoes the bill, it will be one more sign of his willingness to curry favor with the Russian president, Vladimir Putin. At which point Congress should not hesitate to override him. Mr. Trump has already delayed congressional action for months with a fierce lobbying effort; further delays would also hold up new sanctions against Iran and North Korea, which his administration has favored and are included in the legislation.

The new sanctions build on those imposed by Mr. Obama in December. Russia’s two leading intelligence services, the F.S.B. and GRU, were targeted with asset freezes and travel bans, and two Russian compounds in Maryland and New York, reportedly used for spying, were seized. Since then, the revelations about Russian meddling have widened, even pointing to Mr. Putin’s involvement.

Mr. Trump is particularly aggrieved by the provision giving Congress power to overrule him if he tries to lift any of the sanctions, including returning the compounds, as Moscow has demanded. Typically, Congress gives presidents flexibility to temporarily suspend sanctions as a negotiating tool. But Congress believes that he cannot be trusted, and that Russia must be held accountable, even as America should try to work with Mr. Putin on Syria and other matters.

Russia, under economic stress, is worried; an adviser to Mr. Putin said the sanctions would further curb economic growth. On Friday, the country seized two American diplomatic properties and ordered the U.S. embassy to start reducing its staff by September.

The Europeans have their own complaints, one of which is that the sanctions could threaten a pipeline to transport Russian gas into Germany. Senator Ben Cardin, the senior Democrat on the Senate Foreign Relations Committee, made a special effort to consult with the allies and add language that ensures sanctions against such projects can be waived, an aide said. Even so, the allies, unconvinced, are threatening counter-sanctions.