The two men are refocused on something that has always united them: ensuring Israel’s security and long-term survival.

The Palestinian militants who attacked Israel this weekend have done Benjamin Netanyahu a much-needed political favor: They’ve revived his foundering relationship with Joe Biden.

The decadeslong friendship between the Israeli prime minister and the U.S. president had been sorely tested in recent months as Biden urged Netanyahu and his far-right government to abandon efforts to overhaul Israel’s judiciary in ways many Israelis fear will destroy their democracy. Divisions in the Democratic Party over Israel continue to grow. Long gone were the days when Biden expressed outright “love” for Netanyahu — instead, Biden even delayed inviting him to the White House for months.

But the astonishing, multipronged attack by Hamas militants is sure to cast aside those frictions for now. Instead, the two men are refocused on something that has always united them: ensuring Israel’s security and long-term survival. And they’re doing so as both face complex political shifts at home — with their leadership on the line, and the prospect of a second Donald Trump presidency looming.

The crisis follows months of rising Israeli-Palestinian tensions, and as the Biden administration pursues a controversial peace deal in the Middle East that would establish Saudi-Israeli diplomatic ties. Yet the attack appeared to surprise both the Middle East and Washington.