Israel said Wednesday it was prepared to receive remains from Gaza handed over by militants to the Red Cross and that it will begin allowing Palestinians to leave the war-torn territory through a border crossing with Egypt.

Once the remains are returned to Israel, they will be examined by forensics experts to determine whether they belong to either of the two last hostages in Gaza. Remains militants handed over on Tuesday did not match any of the hostages.

The return of all the hostages taken on the Oct. 7, 2023, attack that started the war is a key element of the first phase of the ceasefire that began last month. In exchange, Israel has been releasing Palestinian prisoners.

Under the terms of the ceasefire, the long-closed Rafah crossing is to be opened for medical evacuations and travel to and from Gaza. The World Health Organization says there are more than 16,500 sick and wounded people who need to leave Gaza for medical care.

It was not immediately clear when the border crossing would be opened, however, because of a dispute Israel is having with Egypt, which wants Palestinians to be able to return to Gaza through the crossing.

Israel says Palestinians will not be able to return to Gaza through the crossing until the last hostage remains are returned from Gaza. Egypt, which controls the other side, said the crossing would open only if movement goes both ways.

Once the last hostages' remains are returned and Israel releases more Palestinian prisoners in exchange, the U.S.-backed ceasefire plan is supposed to advance to the next phases.