First came the death of its top leader abroad, Ismail Haniyeh, by a bomb planted in Tehran. Then came Israel’s announcement that, only weeks earlier, it had killed Hamas’s most elusive and revered military leader. All of this as Israel continues to wage the deadliest war Palestinians in the Hamas-ruled Gaza Strip have ever faced.

At first tally, the latest score in the 30-year struggle between Israel and Hamas looks like a devastating one for the Islamist movement, one that throws its future into question. Yet the history of Hamas, the evolution of Palestinian militant groups over the decades and the logic of insurgencies more broadly suggest that not only will Hamas survive, it may even stand to emerge politically stronger.

Analysts and regional observers in contact with Hamas leaders see the latest blows it has suffered — including Mr. Haniyeh’s assassination, widely believed to be at Israel’s hand — as offering Israeli forces a short-term victory at the cost of long-term strategic success.

“Instead of creating the disconnect they’d hoped for, one that would make people fearful or completely defeated, this will have the opposite effect,” said Tahani Mustafa, a senior Palestine analyst at the International Crisis Group, which provides policy analysis on ending conflicts. “Israel just dealt them a winning hand.”

The military campaign Israel has waged in retaliation for Hamas’s Oct. 7 attacks has displaced some 90 percent of Gaza’s two million residents, razed swaths of the enclave’s cities and killed 39,000 people, according to Gaza’s health ministry, which does not distinguish between civilians and combatants.