After 21 months of devastating warfare, Israel and the terrorist group Hamas appear tantalizingly, frustratingly close to a ceasefire that could see the release of some Israeli hostages and a flow of desperately needed food and medical supplies into Gaza. But close is not a deal. We’ve been here before, only to see hoped-for ceasefires fall apart.

The region needs a deal more urgently now than ever. The humanitarian crisis in Gaza has reached catastrophic levels. Almost 60,000 Palestinians have been killed. Virtually the entire Gazan population of 2 million people has been displaced, many repeatedly. Nearly a third of Gazans go for days without eating. Thousands of children are suffering from acute malnutrition, and dozens have died in recent months. Meanwhile, more than 80 percent of Gaza’s health facilities have been damaged or destroyed.

Hamas, which embedded itself among civilians and hides in carefully constructed tunnels, has shown little concern about the civilian population. It insists any ceasefire must lead to a permanent end to the war and a withdrawal of all Israeli troops.

Israeli Prime Minister Benjamin Netanyahu, who just wrapped up a four-day visit to Washington, insists that any permanent end to the fighting include the complete removal of Hamas from Gaza and that Israel retain the freedom to act militarily in the enclave. As the two sides wrangle, the population suffers.

A similar impasse led to the collapse of the 60-day ceasefire in March, after the first phase, which saw the release of 33 Israeli hostages and hundreds of Palestinians held in Israeli jails and a surge of humanitarian aid into the enclave. That deal fell apart primarily because Israel refused to move to the second phase, which was supposed to bring withdrawals of Israeli troops from Gaza, the release of the remaining hostages and the start of negotiations for a permanent end to the war. Israelis were also incensed that Hamas conducted grotesque hostage release ceremonies in which kidnapped victims were paraded onstage and handed “release certificates.”

It was then that Israel imposed its total blockade on humanitarian aid going into Gaza — a punishment of Gaza’s entire civilian population that Israel’s right to defend itself does not justify.

More than 7,000 Palestinians have been killed and more than 25,000 injured in Israeli military strikes since that ceasefire broke down March 18, according to the Gaza Health Ministry, which is aligned with Hamas. Other studies estimate that indirect deaths — from malnutrition, disease and lack of access to medicines and medical care — make the true casualty toll higher.

Israel tried to partially alleviate the Palestinian suffering with the opening of a handful of aid distribution centers run by the U.S.-Israeli Gaza Humanitarian Foundation, but that effort has been a disaster.

Thousands of desperate, hungry Palestinians were forced to trek miles from the remains of their homes in the north, past Israeli military checkpoints, to the few operating distribution sites.

In the pandemonium, Israeli troops have opened fire on hungry civilians. Nearly 800 Palestinians seeking aid have been killed and more than 5,000 wounded since the Gaza Humanitarian Foundation began operating in late May.

The contours of a new ceasefire deal — and a permanent end to the conflict — are plain to see.

In the first phase, a 60-day truce, Hamas needs to account for the 50 remaining Israeli hostages (some of whom are believed dead), and release at least half. Israel must release hundreds of Palestinians and let the United Nations and other international aid agencies into Gaza to start providing food, fresh water, cooking oil, infant formula, diapers, medicines and other essentials.

During the ceasefire, Hamas must be forced to accept — through Qatari and Egyptian mediators — that their reign of terror over Gaza’s population must end. Now might be a good time to coerce Hamas.

The group’s main benefactor, Iran, has been weakened by U.S. and Israeli airstrikes, and Israel has degraded Iran’s main regional proxy, Hezbollah.

Some evidence suggests that Gaza’s population has tired of Hamas, which started this horrific chapter when it launched its Oct. 7, 2023, raid on Israel that left 1,200 Israelis killed in the worst single-day slaughter of Jews since the Holocaust. Hundreds of protesters in May demonstrated, chanting: “All of Hamas, out!”

There must be pressure on Netanyahu, too, specifically to end the military airstrikes that have hit hospitals, schools, refugee camps and food distribution sites. The Israel Defense Force claims it is targeting Palestinian militants. But the spiraling civilian death toll is simply too high.

The longer this calamity persists, the more Israel risks losing what was once its most valuable asset — the bipartisan support of a majority of Americans. The war has dragged on for too long, even as the silhouette of a deal to end it has been long obvious.