JERUSALEM (AP) — The long shadow war between Israel and Iran has burst into the open in recent days, with Israel allegedly striking Iran-linked targets as far away as Iraq and crash-landing two drones in Hezbollah-dominated southern Beirut.

These incidents, along with an air raid in Syria that Israel says thwarted an imminent Iranian drone attack, have raised tensions at a particularly fraught time.

Israel’s Prime Minister Benjamin Netanyahu is looking to project strength three weeks before national elections, while Iran has taken a series of provocative actions in recent months aimed at pressuring European nations to provide relief from crippling U.S. sanctions.

Hassan Nasrallah, leader of the Iran-backed Hezbollah, vowed to retaliate after a drone crashed on the militant group’s Beirut media office and another exploded midair early Sunday. Israeli forces along the border with Lebanon are on high alert, raising fears of a repeat of the 2006 war. Netanyahu has warned Nasrallah to “relax,” saying Israel “knows how to defend itself and how to pay back its enemies.”

The Israeli leader has also addressed Gen. Qassem Soleimani, head of Iran’s elite Quds Force and the architect of its regional entrenchment, telling him to “be careful with your words and be even more careful with your actions.” Israel said Soleimani masterminded the alleged drone attack. Another commander in Iran’s Revolutionary Guard, Gen. Mohsen Rezaei, dismissed the Israeli allegations as a “lie.”

Israel has also blamed Iran for recent rocket fire from the Gaza Strip, and on Monday struck a Palestinian base in Lebanon near the Syrian border.

Israel views Iran as its greatest threat, and has hailed President Donald Trump’s decision to withdraw from the 2015 nuclear deal and re-impose sanctions. But Netanyahu may fear the U.S. is moderating that approach after Trump said there’s a “really good chance” he could meet with Iran’s president.

The two close allies already appear to be at odds over recent strikes on Iran-linked militias in Iraq. In a rare move, U.S. officials acknowledged that Israel was behind at least one of the strikes, and the Pentagon pointedly distanced itself from the Iraq strikes, saying U.S. forces were not involved.

None of the parties is believed to be seeking war, but the potential for miscalculation could lead to a regional conflagration.

ISRAEL

Israel says it is responding to increasingly aggressive moves by Iran and seeking to roll back its regional entrenchment. As Netanyahu fights for an unprecedented fifth term in the Sept. 17 elections, he is eager to display his security credentials and discuss what many Israelis see as his signature achievement — countering Iran and its nuclear program.

Israel has carried out hundreds of airstrikes against Iran-backed forces in Syria since the civil war began in 2011. In recent months it has gone increasingly public with the campaign, immediately confirming the kinds of strikes it used to rarely acknowledge.

Even Netanyahu’s political opponents support the operations, which are aimed at preventing Iran from establishing a permanent military presence on the Syrian frontier. But they have questioned his motives in making them public, with some accusing him of grandstanding, in what they suggest is an attempt to win over voters ahead of the elections.

“There is definitely a more aggressive line now, even if Israel isn’t saying so officially,” said Amos Harel, an Israeli military analyst. “Part of it has to do with the increased Iranian efforts and part of it has to do with all the other considerations.”

Netanyahu’s opponents have hammered him for refusing to strike harder at the Islamic militant group Hamas after recent rocket fire from Gaza. Netanyahu also faces a tide of corruption allegations that have raised the stakes ahead of the vote. He has denied any wrongdoing.

Despite his tough rhetoric, Netanyahu has traditionally been risk-averse in military matters. But he also views countering Iran as his primary mission and may hope to cement his legacy while he has a staunch supporter in the White House.

___

IRAN

Trump’s decision to withdraw from the nuclear deal and impose maximal sanctions on Iran has devastated its economy and left it desperate for relief.

Iran has begun openly breaching limits set by the deal, saying it cannot abide by the agreement unless European signatories offer it a respite from sanctions. In recent weeks, Iran shot down a U.S. military surveillance drone and has been blamed for mine attacks on six oil tankers near the Strait of Hormuz, something it denies. Iran has also seized a British-flagged oil tanker.

At the same time, Tehran has launched a fresh diplomatic offensive, with Foreign Minister Mohammad Javad Zarif making a surprise appearance at the G-7 summit in France as part of a worldwide tour ahead of next month’s U.N. General Assembly.

Experts say Iran seeks sanctions relief and not war, but are alarmed by the potential for miscalculation, either by Tehran or its foes. Iran has spent decades building up powerful allies in Lebanon, Syria, Iraq and elsewhere, which it could call upon in a war with Israel or the United States.

___

HEZBOLLAH

Hezbollah appears likely to respond to the drone attack in order to project strength and establish deterrence, but the nature and scope of its retaliation will depend largely on domestic considerations.

Nasrallah’s pledge to shoot down Israeli aircraft that enter Lebanese airspace is in keeping with the bravado he regularly displays in public addresses, but he will have to weigh his response with the risk of igniting another devastating war.

Lebanon is already mired in an economic crisis that many blame on the government, which is dominated by Hezbollah and its allies. Nasrallah insists such considerations won’t dictate his response, but officials close to Hezbollah’s leadership say it is mindful of being perceived as dragging the country into a ruinous war with Israel that would hasten its economic collapse.

Another consideration is the recent U.S.-mediated efforts to open indirect talks between Lebanon and Israel aimed at demarcating their maritime border, which Lebanon hopes will allow it to begin offshore oil and gas exploration later this year.

Imad Marmal, a journalist close to Hezbollah, wrote Tuesday that the group’s response will be “well studied and proportionate in a way that conveys the categorical message that changing the rules of engagement is prohibited, but without leading to the outbreak of all-out war.”

That may be easier said than done. The monthlong war between Israel and Hezbollah in 2006 was sparked by a cross-border raid in which Hezbollah killed and captured Israeli soldiers. Nasrallah later said he would have never ordered the operation if he had known it would lead to a war of that magnitude.