TEL AVIV, Israel — Hamas on Thursday returned the bodies of four hostages to Israel, prompting a nationwide outpouring of grief as flag-waving crowds lined highways on a rainy day to pay respect to a convoy carrying the coffins and thousands packed a Tel Aviv square in an emotional nighttime vigil.

The dead hostages included an elderly man who had been a journalist and peace activist along with three others said to be a mother and two young boys who became international symbols of the nation’s pain following the Hamas attack that triggered Israel’s war with the militant group in October 2023.

Many people wiped away tears and softly sang the national anthem as the caravan wound through southern Israel — a stark contrast to the celebratory return of 24 living hostages in recent weeks under a tenuous ceasefire that has paused over 15 months of war.

The handover was a grim reminder of those who died in captivity and could provide momentum for the second stage of the ceasefire negotiations. The first phase of the month-old truce between Israel and Hamas is set to end at the beginning of March.

The remains released Thursday were presumed to include Shiri Bibas and her two children, Ariel and Kfir — and the Israeli government confirmed that one of the bodies returned was of Oded Lifshitz, who was 83 when he was abducted. Kfir, who was 9 months old when he was kidnapped, was the youngest captive.

Hamas has said that all four were killed along with their guards in Israeli airstrikes. But Prime Minister Benjamin Netanyahu’s office said Thursday that Lifshitz was killed in captivity by the Islamic Jihad militant group.

Militants who handed over the bodies displayed four black coffins on a stage in the Gaza Strip surrounded by banners, including one depicting Netanyahu as a vampire. On each coffin, a photo of one of the hostages was stapled to the side.

Large numbers of masked and armed militants looked on as the coffins were loaded onto Red Cross vehicles before being driven to Israeli forces. The military later held a small funeral ceremony, at the request of the families, before transferring the bodies to a laboratory in Israel for formal identification using DNA.

In Tel Aviv where the bodies were transported, a double rainbow unfolded across the sky just before sunset. Thousands of people gathered at the city’s Hostage Square and recited traditional mourning prayers. Some held orange balloons, in honor of the Bibas boys, and the crowd swelled after sundown as musicians performed subdued ballads, matching the nation’s grief.

“Our hearts — the hearts of an entire nation — lie in tatters,” Israeli President Isaac Herzog said. “On behalf of the State of Israel, I bow my head and ask for forgiveness. Forgiveness for not protecting you on that terrible day. Forgiveness for not bringing you home safely.”

Lifshitz’s family said after the handover that his remains had been officially identified. His son, Yizhar, told an Israeli TV station that it had brought some closure to the family.