JERUSALEM >> Gaza’s border with Egypt is reopening to allow sick and wounded Palestinians to leave, officials said Friday, after more than eight months during which many who have needed medical care were trapped.

Reopening the crossing at Rafah, which has long been the Gaza Strip’s lifeline to the outside world, is a key stipulation of the ceasefire deal between Israel and Hamas. Mediators hope that the agreement, which has begun with a 42-day ceasefire and hostage-for-prisoner swaps, will ultimately end the devastating 15-month-long war in Gaza.

As part of the truce, Israel agreed to reopen the Rafah crossing after the release of the remaining living female hostages held by Hamas, which took place on Thursday.

Israel committed to allowing up to 50 sick and wounded Palestinian fighters to leave through Rafah per day, in addition to Palestinian women and children who need medical care.

The first group of Gazans was expected to leave today, now that European and Palestinian officials have conducted a trial run of the new arrangements at the crossing, according to two European diplomats who spoke on the condition of anonymity to discuss the delicate preparations.

The World Health Organization said it hoped to bring around 50 critically injured and sick patients through the Rafah crossing today, but it did not identify them. Over 12,000 Gaza residents still need medical evacuation, the organization said.

“If we continue like this, at the pace we have, we will be busy for the next 15 years,” Rik Peeperkorn, the top WHO official for the West Bank and Gaza, told reporters by videoconference.

Hamas had overseen the border between Gaza and Egypt since the group took full control of the enclave in 2007, after winning elections in 2006. Israel then seized the crossing in May during its offensive against Hamas in Rafah.

The crossing is being reopened with a new security arrangement between Israel, Egypt and the internationally backed Palestinian Authority, Hamas’ rival, according to Israeli, Palestinian and European officials who spoke on condition of anonymity to discuss the sensitive diplomacy.

Israel has resisted the notion that the Palestinian Authority would control postwar Gaza, despite the urging of the Biden administration. President Donald Trump’s vision for who might rule the enclave after the conflict remains unclear.

The office of Benjamin Netanyahu, the Israeli prime minister, said that the “practical involvement of the Palestinian Authority” would be only “its stamp on the passports.”