WASHINGTON — The Senate on Wednesday again rebuked President Trump for his continued defense of Saudi Arabia after the killing of the dissident journalist Jamal Khashoggi, voting for a second time to end American military assistance for the kingdom’s war in Yemen and to curtail presidential war powers.

The 54-to-46 vote, condemning a nearly four-year conflict in Yemen that has killed thousands of civilians and inflicted a devastating famine, sets the foundation for what could become Mr. Trump’s first presidential veto, with the House expected to overwhelmingly pass the measure, possibly this month. The vote also might be the opening salvo in a week where Senate Republicans have the opportunity to hit back at the president’s aggressive use of executive power. On Thursday, the chamber will vote on a resolution that would overturn Mr. Trump’s declaration of a national emergency to secure funding for his border wall.

“The United States Congress is going to reassert its constitutional responsibility over issues of war that have been abdicated for presidents, Democrats and Republicans, for too many years,” said Senator Bernie Sanders, independent of Vermont.

Senator Mitch McConnell, Republican of Kentucky and the majority leader, encouraged lawmakers on Wednesday to oppose the Yemen resolution, calling it “inappropriate and counterproductive” and warning them not to conflate their displeasure with the administration’s response to Mr. Khashoggi’s death with the broader issue of the conflict in Yemen. But in a show of defiance, seven Republican senators broke ranks to join the resolution: Mike Lee, of Utah; Susan Collins of Maine; Steve Daines of Montana; Jerry Moran of Kansas; Lisa Murkowski of Alaska; Rand Paul of Kentucky; and Todd Young of Indiana.