The ceasefire in Gaza has destabilised Netanyahu’s government, yet he has no other choice but to commit to it.

It was supposed to be a routine intelligence undercover operation whereby the Israeli agents would infiltrate into “enemy territory”, carry out the mission, and leave without being detected. It had been done before, many times. In fact, over the past two years, Israel had been successful in carrying out two high-profile covert operations, assassinating Hamas drone expert Mohammed al-Zawari in Tunisia in December 2016 and engineer and scholar Fadi al-Batsh in Malaysia in April 2018.

But the Israeli intelligence operation on November 11 in Gaza did not go according to plan. Hamas intercepted it in its early stages, attacking the Israeli commandoes and pursuing them as they tried to flee the strip under the cover of heavy bombardment by Israeli jets. Seven Palestinians were killed in the botched operation, including a prominent al-Qassam Brigades commander, Nour Baraka, and one Israeli officer – an unnamed lieutenant colonel.

Hamas responded by firing hundreds of rockets into Israel, some intercepted by the Iron Dome, others landing in civilian areas, killing one Israeli civilian and injuring dozens of others. Its military wing went as far as targeting an Israeli military bus with a Kornet rocket, a Russian anti-tank guided missile; it was the first time it had used such weapons since the 2014 Gaza war.

The Israeli government also launched days-long air raids on Gaza, bombing civilian buildings and killing five Palestinians, but it could not repair the political damage that had been done.

Hamas was victorious. A video of the Kornet attack was widely circulated in Arab and Israeli media; Palestinians in Gaza started saying “the Kornet defeated the cabinet”.

Prime Minister Benjamin Netanyahu had little space for manoeuvre: he was forced to settle for a ceasefire with Gaza armed groups, which prompted Defence Minister Avigdor Lieberman to resign and plunged his government into a major political crisis.

This time, provoking a new conflict in Gaza in order to take attention away from the domestic political mess he has made is not an option for Netanyahu. He is cornered by a resurgent Hamas and his own geopolitical game in the Middle East, so he needs to keep Gaza quiet.

A stronger Hamas

The Israeli government has insisted that the November 11 operation was not supposed to be an assassination mission, but has not provided further details. Analysts have argued that it was an intelligence gathering operation which was not meant to “trigger a new war”.

Regardless of what Netanyahu wanted to achieve, the only outcome of the botched operation was a win for Hamas. It not only proved the capabilities of its own intelligence – which managed to uncover the Israeli plot early on – but also demonstrated the weaknesses of the Israeli intelligence apparatus, which, while able to carry out complex operations abroad, is ironically failing in neighbouring Gaza.

This was not the first time that an intelligence operation had gone terribly wrong under Netanyahu’s watch. In 1997, he signed off on an assassination attempt against Hamas leader Khaled Meshaal, who at that time was residing in Jordan. After the two Israeli agents, who were supposed to inject him with poison, were caught and beaten up by Meshaal’s bodyguard, a major diplomatic crisis erupted between Israel and Jordan, forcing the Israeli intelligence to hand in the antidote.

Although Netanyahu was cleared of any wrongdoing in a subsequent domestic investigation, the botched operation contributed to his massive defeat in the general elections two years later.

The assassination attempt in 1997 was a win for Hamas, and so was the November 11 failed operation. It has allowed the resistance movement to consolidate its political gains domestically and internationally and demonstrate its military strength.

It has also made evident the fact that Israel’s decade-old blockade of Gaza has done little to weaken Hamas or the resolve of the Palestinian people to resist. Keeping two million people in “the biggest open-air prison” in the world for more than 10 years is not an effective “pacifying” tool.

With a stronger Hamas and a population determined to resist, another war in Gaza would be an even greater disaster for the Israeli government and Netanyahu is well-aware of that. Therefore, after a few days of air attacks on the strip, he had to seek a ceasefire.

The Iran problem

There was also another reason why the Israeli prime minister risked the collapse of his government to maintain calm with Gaza: Iran.

Netanyahu’s top regional priority is countering Iran and its allies with whatever means possible. Keeping Gaza “conflict-free” allows him to curb Iranian influence in the strip and focus his attention on his larger project of confronting Iran in the rest of the Middle East.

The Israeli prime minister is seeking to solidify an anti-Iran front in the Middle East by establishing an alliance with the Arab Gulf states – mainly Saudi Arabia – and the United States and pursuing what has come to be known as “the ultimate deal”.

This “deal” envisions forcing some form of territorial solution for the Palestinian issue onto the Palestinian leadership and full normalisation of relations with Arab states, with the aim of isolating Iran even further in the region. Over the past few months, Netanyahu has upped the ante on normalisation efforts, paying a visit last month to Oman, which traditionally had enjoyed good relations with Iran.

The latest Gaza ceasefire should be seen within this context. Over the past year, Egypt – under US patronage – has made extensive efforts to broker a long-term truce between Hamas and Israel as part of the “ultimate deal“. Calming down the situation after the recent escalation was meant to salvage the progress Cairo had made in that direction.

Netanyahu is also eager to keep Gaza quiet because he is feeling increasingly anxious about countering Iranian presence in Israel’s immediate neighbourhood – Syria and Lebanon.

The downing of a Russian military plane over Syria in September complicated relations with Russia, which until then had allowed the Israeli Air Force to target Iranian facilities at will.

As a result, Russian-Israeli military coordination in Syria is no longer and while Israel still does occasional air attacks, Russia is no longer making it easy for its fighter jets.

The Israeli government is also increasingly wary of Iran’s presence in Lebanon, which could strengthen the military capabilities of Hezbollah.

Although Israel scored another gain against Iran when the US re-imposed sanctions on Iranian oil earlier this month, it has also suffered a major setback in the aftermath of the killing of Saudi journalist Jamal Khashoggi. The uncertainty surrounding the fate of Saudi Crown Prince Mohammed bin Salman – seen as seriously committed to normalisation with Israel – has worried Netanyahu. This has further motivated him to seek some form of a settlement with Hamas.

In this sense, Israel will continue to search for a long-term truce with Hamas as long as the project of confronting Iran remains on the table. For this reason, another full-fledged conflict in Gaza in the near future is unlikely.

The views expressed in this article are the author’s own and do not necessarily reflect Al Jazeera’s editorial stance.