KHAN YOUNIS, Gaza Strip>> Eight more hostages were freed from the Gaza Strip by Hamas-led militants on Thursday in a sometimes chaotic process that briefly delayed Israel’s release of 110 Palestinian prisoners and underscored the fragility of the ceasefire that began this month.

The exchange of hostages for prisoners is a key part of a ceasefire agreement aimed at ending the deadliest and most destructive war ever fought between Israel and Hamas. Fifteen hostages and hundreds of prisoners have been released so far, and the militants still hold dozens more hostages abducted in the Oct. 7, 2023, attack that ignited the war.

Also on Thursday, Hamas confirmed the death of Mohammed Deif, head of its military wing and one of the alleged masterminds of the Oct. 7 attack. Israel said six months ago he was killed in an airstrike in Gaza.

Israelis rejoiced as images of the freed hostages reuniting with their families were shown live on TV. In downtown Tel Aviv, crowds of people gathered outside the hospitals where hostages were taken.

Earlier, masked and armed militants freed three Israelis — after first parading them through unruly crowds in Gaza — as well as five Thai nationals, who were working on farms in southern Israel when the deadliest attack in the country’s history took place.

There was a different joyous homecoming on the other side of the divide. Scores of Palestinians thronged the buses carrying released prisoners into the West Bank city of Ramallah. Some offered wreaths of flowers in the colors of the Palestinian flag and warm jackets to cover the men hoisted on the shoulders of supporters.

Shortly before, Palestinians threw stones outside the prison and Israeli forces fired tear gas to clear the area.

The release of prisoners came hours after militants in Gaza held off thousands of boisterous Palestinian onlookers as they handed hostages over to the Red Cross.

Hamas released seven of the hostages in front of the destroyed home of its slain leader, Yahya Sinwar.

The militant group called it a “message of determination,” but it nearly derailed this month’s third swap and triggered the latest in a series of disputes that have tested the durability of the truce.

The first hostage — female soldier Agam Berger, 20 — was released after Hamas paraded her in front of a smaller crowd in the heavily destroyed urban Jabaliya refugee camp in northern Gaza.

Hours later, at a handover of the other seven in the southern city of Khan Younis, hundreds of militants from Hamas and the smaller Islamic Jihad group arrived with a convoy.

Footage showed hostage Arbel Yehoud, 29, looked stunned as masked militants hustled her through the shouting crowd. Also released were Gadi Moses, an 80-year-old man, and the five Thai laborers. Yehoud and Moses are dual German-Israeli citizens.

The scenes of the hostages being marched through seemingly hostile crowds in Gaza was unnerving for Israelis who became vicarious participants in the hostages’ ordeals. Netanyahu condemned the “shocking scenes” and called on international mediators to ensure the safety of hostages in future releases — a commitment he said he later received.

Among the Palestinian prisoners who were released, 30 were serving life sentences for deadly attacks against Israelis; seven were allowed to return to the occupied West Bank, but the rest were being transferred to Egypt before further deportation.