Hamas released three Israeli civilians and Israel released 183 Palestinian prisoners as part of a ceasefire agreement that has paused 16 months of war in Gaza.