The House on Thursday passed legislation that would impose sanctions on officials at the International Criminal Court, making a frontal assault on the tribunal in a rebuke of its move to charge top Israeli leaders with war crimes for their offensive against Hamas in Gaza.

The bill instructs the president to freeze property assets and deny visas to any foreigners who materially or financially contributed to the court’s efforts to “investigate, arrest, detain or prosecute a protected person.” Protected persons are defined as all current and former military and government officials of the United States and allies that have not consented to the court’s jurisdiction, such as Israel.

The measure is one of several that were pushed through the House by Republicans last year but died in the Democratic-led Senate, and is now all but certain to be enacted now that Republicans control both chambers of Congress and Mr. Trump is taking office on Jan. 20.

Last year, a similar measure drew some bipartisan support in the House but still faced resistance among many Democrats, who joined Republicans in criticizing the I.C.C.’s move to prosecute Israeli leaders but called the sanctions overly broad and ineffective. With Republicans now in charge, the barriers to the bill’s passage appear to have fallen away.

“The I.C.C.’s rogue actions only enable the terrorists who seek to wipe Israel off the map, and they cannot be allowed to stand unchecked,” Senator John Thune, Republican of South Dakota and the majority leader, said on the floor this week. “In November, I promised that if Leader Schumer wouldn’t bring the I.C.C. sanctions bill to the floor, Republicans would. And we’ll soon fulfill that promise and have a vote to support our ally Israel.”

The 243-to-140 vote in the House, in which 45 Democrats joined all Republicans to support the bill, reflected the considerable bipartisan aggravation among lawmakers with the court’s decision to pursue Israeli officials for war crimes and crimes against humanity alongside the leaders of Hamas, whose deadly attack on Israel on Oct. 7, 2023, started a bloody backlash in the Gaza Strip.