Israel and Hamas are not that far from a ceasefire agreement

WHEN HAMAS announced, on the evening of May 6th, that it had agreed to a ceasefire with Israel, the mood in Rafah turned jubilant. Thousands of people cheered and danced in the streets of Gaza’s southernmost city, hopeful that there might soon be an end to the seven-month war that has devastated the Palestinian enclave.

The celebrations were premature. Israeli officials said there were problems with the proposed agreement—that it was different from the earlier text that they had agreed to last month (foreign diplomats insisted the changes were minor). The next morning a column of Israeli tanks rumbled along the Philadelphi corridor, a strip of land along Egypt’s border with Gaza, and seized the Rafah crossing, the main entry point for humanitarian aid throughout much of the war.

Negotiators have not released an official text of either proposed deal: that is not how such sensitive talks work. Still, details have emerged. Diplomats have briefed journalists on the main points of the Israeli offer, and several Arab media outlets sympathetic to Hamas have published what they say is the full text of the group’s counter-offer.

If the latter is accurate, then the two proposals are broadly similar. Both envisage a three-stage ceasefire, starting with a six-week period in which Hamas would release 33 Israeli hostages—women, children, the old and the sick—in exchange for hundreds of Palestinian prisoners in Israeli jails. Israeli troops would begin a gradual withdrawal from Gaza, displaced Gazans would be allowed to return home and more humanitarian aid would enter the enclave.

In the second stage, also six weeks long, the two sides would work towards a “sustainable calm” in Gaza. That term of art is meant to gloss over a major sticking point: Hamas wants the deal to lead to a permanent ceasefire, whereas Israel is only willing to accept a temporary one. The vague phrasing was chosen to satisfy both sides. If they do manage to reach that elusive calm, Hamas would release all of its remaining captives. The third phase would see an exchange of bodies and an end to the war.

But there are a few notable differences between the texts, the most significant of which are related to the hostage release in the agreement’s first stage. The earlier proposal, which Israeli negotiators had agreed to, required Hamas to free three living hostages every three days, up to a total of 33. Hamas is thought to be holding roughly 130 captives. Hamas countered with a more drawn-out schedule: just three per week until the sixth and final week, when the group would free the rest of the agreed-upon 33 captives.

Hamas also dropped the commitment to free living hostages. Instead, it might hand over an unspecified number of bodies. Israeli officials believe that around one-quarter of the hostages in Gaza are already dead. This is only an estimate. For months, Hamas has refused to provide details on the hostages’ well-being. The group insists it cannot check on them until a ceasefire is in place because they are dispersed around Gaza. Israelis dismiss this claim as psychological warfare aimed at the families of the hostages.

There are other disparities. Hamas wants the final say on which Palestinian prisoners are to be released, whereas Israel wants the power to veto at least some of the names. The Islamists also want Israel to withdraw from its military corridor in central Gaza, which would allow both civilians and militants to move freely between the north and south.

These are not trivial differences—but they could probably be resolved through further negotiations. An Israeli delegation was expected to travel to Cairo on May 7th for talks. There could be a week or two of haggling ahead while they try to reach a compromise. The question is whether Binyamin Netanyahu, the Israeli prime minister, actually wants to reach one.

There is broad public support in Israel for an agreement. A survey conducted earlier this month by the Israel Democracy Institute, a think-tank, found that 62% of Israelis (and 56% of Israeli Jews) think a hostage deal should take priority over an offensive in Rafah. Among right-wing Jews, however, the numbers are flipped: 55% think Rafah is more important. And they are Mr Netanyahu’s core constituency.

The prime minister worries, as he has for months, that agreeing to a lengthy ceasefire would push his far-right allies to bolt the coalition, forcing an early election that he looks set to lose. If he rejects one, though, he risks angering America, which is desperate for the parties to strike a deal and prevent a big Israeli invasion of Rafah. Israeli negotiators will have to make difficult choices in their bargaining with Hamas—and then Mr Netanyahu will have to make his own.