This week’s mortar fire on southern Israel is the ‎gravest security escalation on the Israel-Gaza ‎border since “Operation Protective Edge” in ‎the summer of 2014, though Israeli defense officials ‎believe that Israel and Hamas, which rules Gaza, can still avoid a ‎full-fledged ‎military conflict, In fact, they say the choice of ‎what happens next is in the hands of Hamas. ‎

This escalation did not happen overnight. It began ‎with the failure of the so-called “Million Man March” ‎Hamas planned to unleash on the border two weeks ago ‎to mark “Nakba Day,” which commemorates the “catastrophe” of Palestinian displacement during ‎Israel’s 1948 War of Independence. The “million men” ended up being only several thousand, and ended up with fatalities and injuries. Since then, ‎Hamas’s border-riot campaign has also been dwindling.‎

To try to maintain friction with Israeli security ‎forces, Hamas has spared no effort to turn the ‎border area into a terrorist zone, and has ‎given its operatives—and Palestinian protesters—a free hand to carry out terrorist attacks, including ‎hurling firebombs, sending incendiary kites and ‎balloons over the border, and placing explosives on ‎the security fence. ‎

Israeli shelling in response to one of these attacks killed ‎three Islamic Jihad operatives. The terrorist group ‎claimed responsibility for Tuesday morning’s salvo, ‎citing retaliation, but there is no doubt Hamas gave it the green light. ‎

Hamas gambled that Israel would ‎mount the obligatory measured response, and that this would end the current round. This is why its ‎operatives were not involved in any rocket fire then.‎

But Israel mounted a large response instead, striking ‎dozens of terror hubs and destroying a Hamas ‎terror tunnel in southern Gaza. Hamas was pressured ‎to respond, both by its own members and the other ‎terrorist groups in Gaza, and, in a bid to maintain ‎control, it decided to join the ‎fire spree.‎

One defense official called it the “Fatah syndrome,” ‎saying that Hamas’s biggest fear is being ‎perceived, like its rival faction Fatah, as doing ‎nothing to take part in the Palestinian struggle.‎

Still, Hamas made it clear to its operatives that ‎their fire must be limited to the Israeli communities near the border, and that they must avoid a wider range that could ‎compromise larger cities, such as Ashdod, Beersheva ‎and even Tel Aviv. ‎

Israeli defense officials debated the intensity of ‎Israel’s response, but it was widely believed that ‎decisive action was needed to make it clear to Hamas ‎that a red line had been crossed. ‎

From a public diplomacy standpoint, Israel placed ‎responsibility for the escalation in the south on ‎Hamas and Iran, ‎which sponsors the terror organization and spurs it into action. ‎Islamic Jihad was also condemned to a lesser ‎degree, despite its direct involvement. Israel was careful and sought to avoid Palestinian ‎casualties as much as possible. ‎

The Israeli response was meant mostly to give Hamas the necessary ‎leeway to contain the situation before it spirals ‎out of control. Naturally, the Israel military is ready for ‎that to happen, but it still prefers to avoid a ‎wide-ranging military campaign if possible.‎

Egypt and Qatar played roles as brokers Tuesday, to little effect. The decision of where to go ‎from here remains with Hamas. If it mounts a ‎minor response to the Israeli airstrikes in Gaza, Israel will be able to pull back. But if the mortar ‎and rocket salvos continue, the IDF will retaliate ‎forcibly, and the situation could easily deteriorate from ‎there. ‎

The prevailing view in Israel is that Hamas has no ‎interest in such escalation, but its conduct ‎currently is confused and erratic, which is a recipe for ‎mistakes. ‎

Even if an escalation is avoided, this ‎is hardly the end of the story. Gaza is on the ‎brink of eruption for a variety of reasons, most ‎notably the dire economic and humanitarian ‎situation, coupled with growing political and ‎political frustration. Given Hamas’s failure to ‎provide Gazans with any solutions, it can go on one ‎of two paths: a cease-fire or war. Both options are still on the table.‎

Yoav Limor is a veteran Israeli journalist and columnist for Israel Hayom.