In a deeply divided Israel, even the dramatic scene above the country’s skies on Sunday is open to political interpretation.

For supporters of Prime Minister Benjamin Netanyahu, Israel’s display of defensive technology against an Iranian salvo that included hundreds of drones and missiles proves Mr. Netanyahu has long been right to warn about the threat posed by Iran.

His opponents are loath to give him any credit, reserving their praise for the air force.

“Like everything in Israel in recent years, the story is split into two narratives,” said Mazal Mualem, an Israeli political commentator for Al-Monitor, a Middle East news site, and the author of a recent biography of the Israeli leader.

“The division and polarization in Israeli society prevents people from seeing the full picture,” Ms. Mualem added.

Iran’s barrage on Sunday, launched in response to an Israeli attack on an Iranian Embassy building this month in Damascus that killed several high-ranking commanders in Iran’s armed forces, came at a perilous time for Mr. Netanyahu.

At home, he is an unpopular leader whom many hold responsible for his government’s policy and intelligence failures that led to the deadly Hamas-led attack in southern Israel on Oct. 7, which prompted Israel to go to war in Gaza. Abroad, he is the focus of international censure over Israel’s prosecution of that war, which has resulted in the deaths of tens of thousands of Gazans.

How he ultimately emerges from this episode may depend on what happens next.

Mr. Netanyahu now must make a choice. Will he respond to Iran with a forceful counterattack and potentially entangle Israel and other countries in a broader war? Or will he absorb the attack, which gravely injured one 7-year-old girl but otherwise did limited damage, and defer to the coalition that helped defend Israel in the interests of regional stability?

Israel’s allies have been urging restraint.

“The question is whether Israel is going to retaliate immediately, or surprise the Iranians in one way or another,” said Efraim Halevy, who served as director of Mossad, Israel’s intelligence agency, during the latter part of Mr. Netanyahu’s first term in the 1990s.

No Israeli leader has warned about Iran so consistently as Mr. Netanyahu or, for that matter, has spent so long in office. Israel’s longest serving prime minister, he has been in power for about 17 years overall.

Since his first year in office in 1996, Mr. Netanyahu warned that a nuclear Iran would be catastrophic and that time was running out. For the nearly three decades since, he has been sounding the same alarm.

Iran maintains a network of proxy militias across the region, including in Gaza, which the government funds and supplies with weapons. Some of those militias in Yemen, Syria and Lebanon have battled with Israel, creating distractions for the Israeli government and military amid the war with Hamas.

But perhaps more troubling, experts say, is that Iran is closer than ever to obtaining a nuclear weapon. Mr. Netanyahu’s backers still credit him with having put Iran’s nuclear program on the world agenda then, and they praise him now for investing in the mighty, multilayered air defense system that allowed Israel and its allies, including the United States, to intercept the vast majority of Iranian drones and missiles this weekend before they reached Israel.

Sometimes resorting to gimmicks and antics to draw attention to Iran’s nuclear progress, Mr. Netanyahu has in the past made opposing Iran a key part of his global diplomacy. Once, at the United Nations General Assembly he held up a cartoonish drawing of a bomb marked with red lines depicting enrichment levels. Another time, at the Munich Security Conference, he waved around a piece of wreckage from what he said was an Iranian drone sent from Syria and shot down by Israel.

“Everywhere he went he was talking about it,” recalled Jeremy Issacharoff, a former Israeli ambassador to Germany and for years the Ministry of Foreign Affairs point man coordinating diplomatic efforts on regional security and the Iranian threat.

At times, Mr. Netanyahu’s campaign against Iran has severely strained Israel’s relations with American presidents, though bipartisan U.S. support for Israel has long been considered a strategic asset.

Around 2012, Mr. Netanyahu infuriated the Obama administration by pushing hard for President Barack Obama to set clear “red lines” on Iran’s nuclear progress that would prompt the United States to undertake a military strike. Before that, the Israeli prime minister was making plans for a unilateral Israeli strike in the face of tough opposition from Washington and public criticism from a string of former Israeli security chiefs. It was never clear if Mr. Netanyahu was bluffing, and the prospect of an imminent strike receded.

He further challenged Mr. Obama in 2015 with an impassioned speech to a joint meeting of Congress denouncing what he called a “bad deal” being negotiated by the United States and other world powers with Iran to curb its nuclear program.

When President Donald J. Trump came to power, Mr. Netanyahu encouraged him to withdraw from the agreement — a move that many Israeli experts have called a dire mistake and a failure of Mr. Netanyahu’s Iran policy.

“Since then, there have been no constraints on the program,” Mr. Issacharoff said, adding, “It has never been more advanced.”

But it was also under Mr. Netanyahu’s watch that Israel forged diplomatic relations with more Arab states that are considered part of the moderate, anti-Iranian axis, including the United Arab Emirates.

Regardless of what comes next, Ms. Mualem, the Netanyahu biographer, said, “Bibi is still in the game,” referring to him by his nickname. “He’s a central player, and it isn’t over, diplomatically or politically. And he plays a long game.”

world