Garvan Walshe was National and International Security Policy Adviser to the Conservative Party until 2008.

Abba Eban, a former Israeli foreign minister, said of the Palestinians that “they never miss an opportunity to miss an opportunity.” It had seemed until very recently that under Mahmoud Abbas and Salaam Fayyad, his erstwhile Prime Minister, that Eban’s oft-repeated line (for oft repeated it certainly was), had lost its sting.

As Israel was being tied in knots by a Palestinian authority that cooperated with it in arresting terrorists while bolstering its negotiating hand with deft use of international institutions, Abbas suddenly announced an agreement with Hamas, at the end of last week, to set up a jointly backed technocratic administration to lead to elections held within six months.

Hamas, the Islamist movement that violently dislodged Abbas’s Fatah from Gaza in 2006, is, with good reason, one of the few organizations to be designated as a terrorist organisation in its entirety (usually only military wings attract proscription). Little did more to harden Israelis’ hearts to the cost to Palestinians of their occupation than its bloody campaign of indiscriminate suicide bombing or its subsequent rocket attacks on the southern Israeli cities of Sderot and Be’ersheva. Its effect was not to reduce the number of Israelis who think the occupation evil, but to increase the number who think it necessary. Hamas’s charter calls for Israel’s destruction, while its military formations give every reason to be taken at their word.

The timing of the announcement looks exceedingly odd.

First, it was just the shove needed to prise Benjamin Netanyahu off the petard on which he had hoisted himself, having been blamed (correctly) for reneging on an agreement to release prisoners. The collapse of the talks threatened to bring down his coalition government, half of whose members wanted to see the peace process continue. Abbas has relieved Tzipi Livni, Israel’s Minister of Justice, and Yair Lapid, its Finance Minister, of the need to denounce their own Prime Minister, and has handed them a reason to stay in the government and avoid demotion in an alternative coalition – or elections in which their parties are expected to do terribly. They are now in his debt.

Second, as Daniella Peled has written in the Spectator, Hamas is in trouble. Last summer’s military coup cut off their support in Cairo. Its Muslim Brotherhood parent organisation is under siege in Egypt and now under investigation in London. Most Arab governments are now determined to crush the brothers once and for all. Particularly crucial, perhaps, is their military failure. Israel’s security barrier has made suicide bombings almost impossible.

Rocket attacks don’t work either. Israel had once to engage in aerial bombardment that looked excessive even to its friends in the West.  But it has since invested considerable sums in missile defence systems that now defend the country reasonably well against Hamas’s cheap, numerous rockets by targeting their launch sites with precision-guided bombs which cause fewer civilian casualties – thus rendering the tactic obsolete. A technological arms race between Israel and Hamas would be a walkover. Hamas had promised the practical good of administrative competence and the metaphysical joy of ideologically pure resistance. But Gaza is economically isolated, and Israel has found ways to outwit Hamas strategically. Once more popular than Fatah, the Islamic Resistance Movement now trails them in the polls.

Far from being an end to the power struggle within Palestinian politics, this latest deal could well be its next phase. Absent from its text was any discussion of who will control the security forces in the West Bank and Gaza. “Unity” based on two separate and opposing armed forces groups won’t last long. Furthermore, the agreement implies a willingness to accept the outcome of the election and the legitimacy of the state structure that comes out of it. If Fatah wins, Hamas would have to add electoral defeat to its list of existing achievements: economic incompetence, plus military failure and diplomatic isolation. They might try to return underground, but this time they would have little other than force on which to justify their existence. It’s evidence of their weakness that they signed up to this agreement in the first place.

If the rumours that Abbas is planning to retire and arrange for a successor (possibly Mohammed Dahlan), this could be his last gamble. If the polls prove accurate, Hamas will be marginalised and Fatah can return to negotiations later, with a claim to represent all of Palestine. But if they are not, Palestinians could be represented by a government that Israel has every reason to ignore, for which the international community will care little and which major Arab governments will strive to undermine.

For the gamble to work, the West has to to exercise its responsibility to isolate Hamas until it accepts the three quartet conditions: to abandon violence, recognise Israel and abide by previous agreements made by the Palestinian Authority (PA) and PLO. Then, in six months, Palestinian voters may well face a choice of enormous significance: whether they want a PA engaged with a world that needs its institutions to secure independence – or whether to return to isolated resistance.