For the leaders of both Hamas and Israel, ending the war in Gaza has become a deadly game of survival.
The terms on which the war finally ends could largely determine their political future and their grip on power. For Hamas leader Yahya Sinwar, even his physical survival.
It’s partly why previous negotiations have failed. It’s also why the question of how to permanently end the fighting has been put off to the last stages of the plan outlined by US President Joe Biden on Friday.
That transition between talks on a limited hostage-for-prisoner deal to discussions about a permanent ceasefire would, Mr Biden acknowledged, be “difficult”.
But it’s also where the success or failure of this latest deal is likely to hinge.
The US says it has submitted a draft resolution to the UN Security Council supporting the ceasefire plan outlined by President Biden. The three-phase plan involves an end to the conflict, the release of the hostages and reconstruction of the Palestinian territory.
Israel’s Prime Minister, Benjamin Netanyahu, has strong domestic reasons for wanting to take this deal step by step.
Phase one, as outlined by Mr Biden, would see the release of dozens of hostages, both living and dead. That would be widely welcomed in a country where the failure to free all those held by Hamas is, for many, a glaring moral stain on Mr Netanyahu’s management of the war.
But Hamas is unlikely to give up its most politically sensitive hostages – women, wounded, elderly – without some kind of guarantee that Israel won’t simply restart the war once they’re home.
Leaks, quoted by Israeli media on Monday morning, suggested that Benjamin Netanyahu has told parliamentary colleagues that Israel would be able to keep its options open.
That option, to resume fighting – until Hamas is “eliminated” – is, some believe, the least Mr Netanyahu’s far-right coalition partners will demand.
Without their support, he faces the prospect of early elections and the continuation of a corruption trial.
Mr Netanyahu needs to keep his long-term options open, to stand a chance of winning their support for any initial hostage deal. Hamas leaders, on the other hand, are likely to want permanent ceasefire guarantees upfront.
Previous deals have collapsed into this chasm. Bridging it now will depend on how much room for manoeuvre Mr Netanyahu has with his hard-right government allies to find alternatives to the “elimination” of Hamas – and how far Hamas leaders are prepared to consider them.
Mr Netanyahu talked over the weekend about the destruction of Hamas’s “military and governing capabilities” and ensuring that the group no longer posed a threat to Israel.
Few dispute that Hamas has suffered major losses to its military infrastructure – and even, some say, to its public support within Gaza and its control of the streets.
But there’s no sign that Israel has killed or captured its top leaders Yahya Sinwar and Mohammed Deif, and leaving them free in Gaza to celebrate the withdrawal of Israeli forces would spell political disaster for Israel’s embattled prime minister.
On Monday a US State Department spokesman said that although Hamas’s capabilities had “steadily degraded” in recent months, it remained a threat and the US did not believe the group could be eliminated militarily.
Meanwhile the White House said Mr Biden had “confirmed Israel’s readiness to move forward with the terms that have now been offered to Hamas” and said the Palestinian group was now the only obstacle to a deal.
Separately, military spokesman Rear Admiral Daniel Hagari said the Israeli military would be able to ensure Israel’s security in the event of any truce agreed by the government.
However Yanir Cozin, diplomatic correspondent with Israel’s military radio station, GLZ, believes that Mr Netanyahu won’t end the war until he can frame it as a success.
“A deal that leaves Hamas is a big failure,” he said. “Eight months on, when you haven’t achieved any of the war goals – not finishing Hamas, bringing all the hostages back, or securing the borders – then he doesn’t want to end the war. But he also understands that he cannot leave it until the next Israeli election in 2026.”
“If he can say, ‘We exiled Yahya Sinwar and Mohammed Deif, they’re not living in Gaza’ – and if the people living close to Gaza and the northern border can go back – I think he can keep his government together. But it’s a lot of ‘ifs’.”
Hamas is very unlikely to agree to the exile or surrender of its top figures. But there are clear splits emerging between Hamas leaders inside and outside Gaza.
Former Israeli prime minister Ehud Barak, who has also served as defence minister, told Israeli radio on Monday that President Biden had announced the deal “after seeing that Netanyahu only moves ahead when he’s certain that Sinwar will refuse”.
“How do you think Sinwar will react when he tends to agree and then he’s told: but be quick, because we still have to kill you after you return all the hostages,” he said.
In the meantime, tens of thousands of Israelis displaced after the Hamas attacks on 7 October are watching their prime minister’s next move.
Among them is Yarin Sultan, a 31-year-old mother of three who ran from her home in Sderot on Gaza’s border the morning after the Hamas attacks. She says she won’t go home until Yahya Sinwar and Mohammed Deif are no longer free.
“This ceasefire will kill us,” she told the BBC. “We will free the hostages, but a few years from now you will be the next hostages, you will be the next people who get murdered, the women that are raped – all this will happen again.”