CAIRO (AP) — Israel and Hamas have agreed to a pause in their devastating two-year war and the release of the remaining hostages in exchange for Palestinian prisoners — a breakthrough greeted with joy and relief Thursday but also caution.

Uncertainty remains about aspects of the broader peace plan advanced by the administration of U.S. President Donald Trump — such as whether and how Hamas will disarm and who will govern Gaza. But the sides appear closer than they have been in months to ending a war that has killed tens of thousands of Palestinians, reduced much of Gaza to rubble, brought famine to parts of the territory, and left dozens of hostages, living and dead, in Gaza.

The war, which began with Hamas’ deadly attack on Israel on Oct. 7, 2023, has also triggered other conflicts in the region, sparked worldwide protests and led to allegations of genocide that Israel denies.

Even with the agreement expected to be signed later in the day, Israeli strikes continued, with explosions seen Thursday in northern Gaza. There were no immediate reports of damage or casualties.

An Israeli military official who spoke on the condition of anonymity in line with military guidelines said that Israel was continuing to hit targets that posed a threat to its troops as they reposition.