NO SOONER had Israel finished one war with the Islamist fighters of Hamas in Gaza, on its southern border, than al-Qaeda began knocking on its gates at the other end of the country, in the north. On August 27th Jabhat al-Nusra, al-Qaeda’s affiliate in Syria, overran the Syrian army’s positions at the Quneitra border-crossing on the Golan Heights, which Israel has occupied for almost half a century. For most of the three-year-long rebellion in Syria, Israel has tried to keep out of the fray. But now it may lean towards favouring President Bashar Assad.

The UN has long patrolled the Syrian side of the Golan Heights, with a 1,250-strong Disengagement Observer Force (UNDOF). But at the end of August Jabhat al-Nusra scattered the UN’s Filipino contingent and has since held hostage another 45 Fijian soldiers. UNDOF’s Austrian, Croatian and Japanese units had previously withdrawn. The Filipinos are set to go, too.

Israel is in a quandary. Until recently, it reckoned that the military frontier with Syria was the quietest of its four borders with Arab states (the others being with Egypt, Jordan and Lebanon). But the Syrian side is now in the hands of Islamist rebels virulently hostile to it, with neither the UN nor Syria’s army in place to uphold a longstanding armistice.

When Syria’s uprising erupted three years ago, Israel’s government stood aloof but quietly hoped that, if Mr Assad went, the hostile Shia axis that extended from Iran through Damascus to southern Lebanon, where Hizbullah prevails, would be broken. Israel’s then defence minister predicted that Mr Assad would soon fall.

But Israel’s attitude wavered as Jabhat al-Nusra, whose leader, Abu Muhammad al-Jolani, takes his name from the Israeli-occupied Heights, bested the more moderate Free Syrian Army in Syria’s south. Now that the Islamists have taken over the Quneitra crossing, the Israeli government may be tacitly approving of Mr Assad’s bombing of rebel positions inside the narrow demilitarised zone. “It’s in Israel’s interest that Assad controls the gate and not radical Islamist groups,” says Kobi Marom, a retired Israeli brigadier, watching from a hill above Quneitra.

On the wider front, the rise of the anti-Western and anti-Israeli Islamic State (IS) in eastern Syria is making a growing number of Israeli planners think that Mr Assad’s survival is their least-bad option, says Eyal Zisser, an Israeli expert on Syria. And yet, conversely, some of Israel’s security men worry that a major counter-attack by Mr Assad’s army against rebel positions near Quneitra may lead to a menacing build-up of Iranian and Hizbullah forces there. No outcome for Israel is palatable.