The hostages were freed in a heavily staged handover, ahead of the expected release of 200 Palestinian prisoners.