As part of the swap, Palestinian militants in Gaza freed five Thai and three Israeli hostages, handing them over to the Red Cross amid chaotic crowds.
Three Israelis and five Thai nationals were freed earlier in what PM Benjamin Netanyahu called "shocking scenes".
Hamas released seven of the hostages in front of the destroyed home of its slain leader, Yahya Sinwar, as thousands pressed in.