The morning after Israel carried out twin assassinations with pinpoint accuracy—in the capitals of two enemy countries—a surprising number of Israelis came out of their homes and handed out candies to passersby to celebrate the deaths of two implacable foes.

This was a new phenomenon, imitating what many residents of Arab towns do when their enemies are killed.

“We used to perceive ourselves as part of the Western world and its values,” columnist Alon Pinkas says. He was a New York–based Israeli diplomat from 2000 to 2004. “Now we are trending toward adopting the low standards of our enemies.

True blue: Donald Trump welcomed Netanyahu at Mar-a-Lago last month.

No one can blame Israelis for seeking a rare feeling of triumph in an ugly and difficult year. But the fact is that the twin killings, in Tehran and Beirut, brought the Middle East to the brink of a wider regional war, one that could bring the United States into the fray. And critics increasingly complain that Prime Minister Benjamin Netanyahu is prolonging combat to try to stay in power, or to sabotage steps toward a two-state solution—or both.

Many in Israel briefly savored what felt like a win. After all, the whole nation is still shell-shocked by the Hamas incursions and massacres last October 7, the war in Gaza that ensued, Hezbollah missiles raining down daily from Lebanon, and the gloom of a hostage crisis.

A surprising number of Israelis came out of their homes and handed out candies to passersby to celebrate the deaths of two implacable foes.

Officials in the government, the military, and the security services spoke mournfully all year of a need to restore “deterrence”—which means having the entire Middle East fear Israel’s power. Deterrence was shattered by the humiliating security failures of October 7.

The latest assassinations, coupled with a highly destructive Israeli air raid on a Houthi port in Yemen on July 20, demonstrated Israel’s capability to reach out, find, and eliminate enemies far and wide. Yet Israel’s many headaches persist. The attacks on Iran’s proxies, Hezbollah and Hamas—especially because of the killing in Tehran—could spark a rapid escalation to all-out war with Iran and the angry armed groups it sponsors.

Since the start of the Gaza war—with the Israelis claiming major progress but clearly failing at the declared goal of destroying Hamas—the government has turned to targeted killings to create a semblance of accomplishment.

“Israel fell in love with assassinations,” a former top Mossad official tells us, “and even got addicted to them.”

People on the inside of Israeli intelligence know that this is no time for blithely handing out candies. “We in the Mossad were never allowed to pop champagne corks and rejoice after an assassination,” the former Mossad official tells us. “Killing someone was sometimes a necessity, but not a source of pride. It isn’t a tank battle, or an aerial dogfight, in which the best one wins. We knew it’s just an ambush, in which you take the enemy by surprise with a bullet in his back or a bomb or rocket into his room.”

An Israeli woman in Tel Aviv photographs a billboard covered with images of hostages held by Hamas since October 7.

That is precisely what happened when Israel killed Hezbollah’s top military commander in Beirut and, six hours later, the political leader of Hamas, Ismail Haniyeh, while he was visiting Tehran. The air force carried out the Beirut strike, but when it came to the Tehran attack, Israeli intelligence officials may have sought to rattle Iran’s leaders by leaking a story of a remotely detonated bomb planted months ago in the V.I.P. guest apartment used by Haniyeh.

By ordering the twin attacks, Netanyahu had to know he was playing with fire. The risk of a wider, more intense, and bloody war immediately grew immensely.

Indeed, both Hezbollah and the supreme leader of Iran, Ayatollah Ali Khamenei, publicly vowed powerful revenge against Israel. Many of the Israelis who were happy on Wednesday morning were deeply worried by nightfall.

Proud of eliminating Fuad Shukr, the target in Beirut, the Israel Defense Forces (I.D.F.) blamed him for the rocket attack that killed 12 children on a soccer field in Israel’s Golan Heights last weekend. Shukr had also been sought by the United States, which had offered a $5 million reward because of his “key role” in the Beirut bombing that killed 241 U.S. military personnel in 1983.

“Israel fell in love with assassinations,” a former top Mossad official tells us, “and even got addicted to them.”

Much the way it has treated other assassinations in Iran, Israel chose not to declare publicly that it had killed Haniyeh, a former Palestinian prime minister who was running Hamas’s nonmilitary activities from his home-in-exile, in Qatar.

The retired Mossad official told us that assassinations—especially in a hostile country where the risks are high—are a last resort reserved for times when an enemy threat cannot be stopped in any other way. Targeted killings became an instrument of strategy in 2007, and since then, at least six nuclear scientists have been murdered in Iran. The goal was to intimidate educated Iranians so that they would not help their country develop a nuclear bomb.

The Mossad, and the military’s even larger intelligence agency, Aman, tracked leaders of Palestinian and Shi‘ite terrorist groups, and on occasion prime ministers ordered that they be killed. Just once, in 2008, the Mossad and the C.I.A. carried out a joint assassination in Damascus , eliminating Fuad Shukr’s notorious predecessor in Hezbollah, Imad Mughniyeh. But history has shown that little was accomplished, as Hamas and other groups quickly installed replacements.

On July 28 in Majdal Shams, in the Golan Heights, Israeli mourners attend the funeral of the 12 children and teens killed in a Hezbollah rocket strike a day earlier.

There also have been targeted air strikes that killed dozens of senior Hezbollah men in Lebanon, since that group has shown solidarity with the Gaza Palestinians by attacking northern Israel. Hezbollah has launched so many rockets that 80,000 Israelis have abandoned their homes near the Lebanese border over the past 10 months.

Netanyahu seems to lack any coherent plan for ending the multi-front war, which has greatly damaged the Israeli economy and general morale. He warned the country again this week that patience is needed, hinting at years of war still to come.

So what are Netanyahu and the influential right-wing members of his Cabinet trying to achieve? Critics of the prime minister say his chief goal is to hang on to power, largely so he can continue to delay the trial in which he is charged with corruption and bribery. As for the radical ministers, they want to block any two-state peace plans so that the Jewish state can keep the West Bank—and perhaps the Gaza Strip—forever.

It was clear, in a speech Netanyahu gave after the twin assassinations—without explicitly acknowledging the killing in Tehran—that he has made the nearly impossible goal of “total victory” his top priority. That matched his controversial speech to Congress in Washington the prior week.

Families of the 115 hostages, mostly Israelis, still held by Hamas in Gaza are heartbroken that Netanyahu has not made freeing their loved ones his sole and overriding objective. Israeli officials believe around half are likely dead.

“For Netanyahu, the war is an aim in itself,” Noam Tibon, a retired Israeli general, told us. “He knows that releasing the hostages requires a ceasefire that would lead to ending the war. His radical coalition partners would leave him and his government would collapse.” An election would be called, and polls indicate that the incumbent would sustain a massive loss. That would leave the eloquent, wily, longest-serving prime minister of Israel in the pages of history as—in Tibon’s words—“the country’s worst.”

So if the twin assassinations, so stunningly efficient, have the effect of ruining chances of negotiating a hostage deal—obstructing an end to the Gaza war, which the United States and many other governments are urging—that may well suit Netanyahu just fine.

Yossi Melman is a Tel Aviv–based intelligence analyst for Haaretz. Dan Raviv, based in Washington, is a former foreign correspondent for CBS News. Their books include Spies Against Armageddon: Inside Israel’s Secret Wars