Israel’s bombing of an Iranian Embassy building in Damascus, which killed senior Iranian military and intelligence officials, is a major escalation of what has long been a simmering undeclared war between Israel and Iran.

Iran promises major retaliation, and the danger of a miscalculation is ever-present. But given the stakes for both countries, neither Israel nor Iran wants a major shooting war, even as they press for advantage in Gaza and southern Lebanon.

Instead, the strike is a vivid demonstration of the regional nature of the conflict as Israel tries to diminish and deter Iran’s allies and surrogates that threaten Israel’s security from every direction.

It is often called “the war between the wars,” with Israel and Iran as the main adversaries, sparring in the shadows of the more evident hostilities around the region.

The Iranian officials who were killed Monday had been deeply engaged for decades in arming and guiding proxy forces in Gaza, Lebanon, Syria, Iraq and Yemen as part of Iran’s clearly stated effort to destabilize and even destroy the Jewish state.

For Israel’s prime minister, Benjamin Netanyahu, who presumably approved such a sensitive attack, the successful elimination of such key Iranian military figures is a political coup. It comes at a time when demonstrations calling for his resignation have increased in intensity, as the war against Hamas drags on and Israeli hostages remain in Gaza.

Displaying its ability to infiltrate Iranian intelligence, Israel is trying to hit the operational part of Iran’s regional proxies, its so-called Axis of Resistance to Israel, aiming to disrupt and deter them, even as the war in Gaza continues.

Since the war began in October, Israel has begun to target key Iranian officials responsible for relations with its proxies, not just the advanced weapons Tehran delivers, said Ali Vaez, Iran project director for the International Crisis Group.

But no matter how many experienced generals Israel eliminates, “no one is irreplaceable in the Iranian system,” he said. “Iran knows this is a perilous game and there is a price tag attached.”

Some worry that price may be borne by Israeli allies. Ralph Goff, a former senior C.I.A. official who served in the Middle East, called Israel’s strike “incredibly reckless,” adding that “the Israelis are writing checks that U.S. CentCom forces will have to cash,” referring to the U.S. military’s Central Command.

“It will only result in escalation by Iran and its proxies, which is very dangerous” to U.S. forces in the region who could be targeted in retaliatory strikes by Tehran’s proxies, Mr. Goff said.

Mr. Netanyahu has emphasized for years that Israel’s main enemy is Iran and the strike could help him “rehabilitate his reputation as ‘Mr. Security,’” said Sanam Vakil, director of the Middle East and North Africa program at Chatham House. Even so, it may not be enough, she said, with Israel bogged down in Gaza, Hamas so far unbeaten and Iran and its proxies undiminished.

Iran has vowed retaliation and revenge for what it called an unprecedented attack, but, since Oct. 7, “Iran has been clear that it does not want a regional war,” Ms. Vakil said. “It sees this conflict with Israel playing out over a longer time frame.”

U.S. officials do not believe that Iran initiated the Hamas attack or was even informed about it in advance. Yet Iran still sees Gaza as “a victory for them, because it isolates Israel and puts it on the defensive in the region and the world,” said Suzanne Maloney, director of the foreign policy program at the Brookings Institution.

The ongoing war and its civilian toll make it “almost inconceivable to create a vision of the Mideast that Israel and the U.S. and the Saudis were hoping to engineer before Oct. 7,” she said, one of regional recognition of Israel by Arab nations opposed to Iran’s growing influence.

Still, Ms. Vakil said, “this strike will be difficult for Iran to ignore,” since “it is a direct attack on its territory,” an embassy building, and killed three senior commanders of Iran’s Quds Force, the external military and intelligence service of the Islamic Revolutionary Guards Corps.

Iran said the Israeli strike killed an Iranian general, Mohammad Reza Zahedi, along with his deputy, a third general and at least four other people, reportedly including senior officials of Palestinian Islamic Jihad, an Iranian affiliate that is also fighting in Gaza.

The killing of General Zahedi, who was said to be in charge of Iran’s military relationship with Syria and Lebanon, is widely considered the most important assassination of an Iranian leader in years.

Yaakov Amidror, a former Israeli national security adviser, called the death of General Zahedi “an enormous blow to Iran’s immediate capabilities in the region.” He had helped oversee Iran’s attempt to build a “ring of fire” around Israel via its militant proxies while keeping Tehran’s involvement at arm’s length, Mr. Amidror said.

But how and when Iran chooses to retaliate will further raise the stakes. The most obvious recent example is its response to the assassination four years ago by the United States of Qassim Suleimani, the commander of the Quds Force. Then, Iran launched a major missile attack against an American base in Iraq, but only after warning of the attack in advance. There were no immediate U.S. casualties, though more than 100 military personnel suffered traumatic brain injuries, the Pentagon later said.

An anxious Iran, on high military alert, also shot down a Ukrainian passenger jet, killing 176 people, believing it to be an enemy plane.

“But one of the lessons from Suleimani is that even if you take out someone critical, the network and the redundancy Iran has established with the groups survives quite well,” Ms. Maloney said.

Recently Iran has tried to de-escalate the tensions in its relationship with the United States after a January drone attack on a U.S. military base on the Jordanian-Syrian border killed three American soldiers.

But Iran may be more willing to risk a military escalation with Israel.

It could make other choices — a major cyberattack on Israeli infrastructure or its military, a barrage of rockets from southern Lebanon, a similar assassination of an Israeli commander, an attack on an Israeli embassy abroad, or another sharp acceleration of its nuclear-enrichment program.

The last would be a kind of direct riposte to Mr. Netanyahu, who has long warned about the danger of a nuclear-armed Iran and vowed to prevent it from happening. (Iran has always insisted that its nuclear program is purely peaceful, even as it has enriched uranium to close to weapons grade.)

Or Iran could bide its time. Mr. Amidror, the former Israeli national security adviser, said he doubted the strike would lead to a broader escalation between Israel and Iran, such as an all-out war involving Hezbollah along Israel’s northern border.

“Their interests haven’t changed in the aftermath. They’ll look for revenge, but that’s something else entirely,” he said, and it does not have to be limited to the immediate region.

One previous example he cited was the 1992 bombing of the Israeli embassy in Buenos Aires by Islamic Jihad, which killed 29 people and came in response to Israel’s assassination of the Hezbollah leader Abbas al-Musawi.

Originally published in The New York Times.