The Israeli government approved a ceasefire deal with Hamas early Saturday that calls for the release of dozens of hostages and hundreds of Palestinian prisoners after hours of deliberations, setting up a reprieve in the 15-month, devastating war in the Gaza Strip.

The Israeli prime minister’s office, which announced the agreement after the full Cabinet voted, said the deal would go into effect Sunday.

Palestinians have celebrated the provisional ceasefire with the hope that it will finally end the conflict, and Israelis are anxiously awaiting the return of scores of captives abducted by Hamas.

Daniel Lifshitz, whose grandfather Oded, 84, was among the 250 captives taken in the Hamas-led attack on Israel on Oct. 7, 2023, said, “The stomach is turning, and the heart is poured out on the floor, but it’s what we’ve been waiting for.”

The initial attack killed about 1,200 people, setting off a wave of bombardments by Israel that has killed more than 46,000 Palestinians, according to Gaza health officials, who do not distinguish between combatants and civilians.

The vote Saturday was the second and final one required to approve the ceasefire and hostage release agreement. Hours earlier Friday, the security Cabinet voted to approve it, overcoming a key hurdle to enacting a deal that U.S. and other diplomats see as the best chance to end the war. Hamas had said that there were no longer any barriers to the agreement.President Isaac Herzog of Israel, who holds a largely ceremonial role, had hailed the security Cabinet’s vote, although he acknowledged the difficulties ahead in enacting the agreement. “I harbor no illusions — the deal will bring with it great challenges and painful, agonizing moments,” he said in a statement.

Under the agreement, both sides would begin a six-week truce, during which Israeli forces would withdraw eastward, away from populated areas. Hamas would free 33 of the hostages still in captivity, mostly women and older people.

Lifshitz’s grandfather is among the hostages set to be released in the deal’s initial phase, but the family has no information about his well-being or whether he is alive. “Preparing for a festivity and a funeral simultaneously is impossible,” he said.

Israel would also release hundreds of Palestinian prisoners, including some serving long sentences for attacks on Israelis. On Friday evening, the Israeli government released a list of 95 Palestinian prisoners that it said would be among the first to be released Sunday, including Khalida Jarrar, a prominent lawmaker in the Israeli-occupied West Bank.

The ceasefire agreement passed with 24 ministers voting in favor and eight ministers opposed, according to an Israeli official who spoke on condition of anonymity. Most ministers who voted against the deal belong to two far-right parties that had denounced the deal, the official said.

The truce would be the first since November 2023, when 105 hostages were freed in a weeklong ceasefire in exchange for 240 Palestinian prisoners.

A host of questions has shadowed the celebrations among relatives of hostages, Gaza residents desperate for the war to stop and diplomats who have struggled for months to broker a truce. What happens after the first phase of the ceasefire deal, set to last 42 days, is unclear, including whether Israel intends to pursue a second phase of the deal and an enduring ceasefire in Gaza, allowing the remaining hostages to return home.

“I’ll be the happiest man alive to see any one of the hostages return, but there’s also immense worry over the second phase,” said Doron Zexer, a prominent activist for the release of an Israeli American hostage, Edan Alexander.

As the full Cabinet met Friday, at the beginning of the Sabbath, Israeli Prime Minister Benjamin Netanyahu was facing an internal rebellion from far-right partners whom he depends on to hold together his governing coalition.

On Thursday night, one such partner, the hard-line national security minister, Itamar Ben-Gvir, announced he would resign from the coalition if the Cabinet approved the ceasefire deal. Finance Minister Bezalel Smotrich has also threatened to quit the government if Netanyahu proceeds from a first phase of the ceasefire to a permanent one.

Their moves would not, on their own, prevent the initial phase of the Gaza deal from moving ahead. But they would create more uncertainty about Israel’s commitment to a ceasefire in the long term, as hard-line members of the government push for Israel’s military to resume the war and seek Hamas’ destruction.

Also unclear is a plan for postwar Gaza, despite optimistic assertions of departing officials in the Biden administration. U.S. Secretary of State Antony Blinken told reporters Thursday that the ceasefire was “a moment of historic possibility for the region,” creating opportunities for lasting peace, Gaza’s reconstruction, “a credible pathway to a Palestinian state” and normalized relations between Israel and Saudi Arabia.

But while President Joe Biden said Thursday that he had pushed Netanyahu to accommodate Palestinian concerns, the Israeli prime minister has consistently rebuffed U.S. calls to work toward an eventual Palestinian state.

Even after negotiators announced a ceasefire deal, deadly Israeli airstrikes continued in Gaza. The Israeli military said Thursday that it had struck about 50 targets across the territory over the previous day, while Gaza officials reported dozens of people killed.

“The ceasefire feels meaningless,” said Ahmad al-Mashharwi, who was sheltering with more than a dozen relatives in a rented house in Gaza City, in a phone interview Friday. “Artillery and airstrikes continue around us, especially in northern Gaza.”

He said conditions in northern Gaza were dire, with prices soaring and basic goods in short supply.

“We can’t afford food or clean water, and my children are going hungry,” al-Mashharwi said. “We’ve been stripped of everything — there’s no safety, no resources, nothing to help us survive.”

The ceasefire is supposed to pave the way for more humanitarian aid to reach Gaza. The World Health Organization said Friday that it hoped aid deliveries would accelerate sharply to between 500 and 600 trucks daily from 40 to 50 a day in recent months, and allow the first steps toward restoring health services after more than a year of war.

“We will see if the political will is there and impediments are taken out and routes are opening up,” Dr. Rik Peeperkorn, the WHO representative for Palestinian territories, told reporters Friday.