American, Israeli and Lebanese officials insist that few parties want Israel’s war in Gaza to become a wider conflict that engulfs the Middle East.

But the assassination of a top leader of Hamas in Lebanon on Tuesday, and the deaths of scores of people in mysterious twin explosions in Iran on Wednesday, threatened to bring the Middle East — and the United States — closer to the brink of a regional war, which the Biden administration has tried to stave off since Hamas’s deadly attacks against Israel on Oct. 7.

Just hours after the bombs went off in Iran, the United States and 12 of its allies issued a written warning to another militia group in the region, the Houthis of Yemen, who have been mounting near-daily missile, drone and seaborne attacks on commercial vessels.

So far the United States has held back from retaliating against Houthi bases in Yemen, in large part because it does not want to undermine a fragile truce in Yemen’s civil war.