Hamas released three more hostages in an exchange that almost never happened as part of a ceasefire that nearly collapsed.