The second prisoner exchange under the ongoing ceasefire deal saw Hamas release four Israeli soldiers, all women, in return for 200 Palestinian prisoners.
The International Committee of the Red Cross collected the hostages from Hamas fighters in Gaza on Saturday morning.
Crowds gathered in Gaza City, where the exchange took place. In Tel Aviv, Israelis watched nervously as their release was broadcast in a public square.
Hamas announced the names of the soldiers on Friday: Karina Arif, Daniel Gilboa, Naama Levy, and Liri Elbag. According to the agreement, Israel would free 200 Palestinian prisoners in return.
The swap is the second time hostages have been released under the terms of a ceasefire deal that has temporarily halted the 15-month-long war.
Under the terms of the deal, Israel will release hundreds of Palestinian prisoners, many of whom have been forcefully taken from their homes and illegally detained, and Hamas will hand over 33 hostages. Hamas is believed to hold around 100 Israelis.
In a statement, the Israeli military said the freed hostages would receive medical care upon their return from Gaza before being transferred to hospitals and reunited with their families.