Hamas militants released three male Israeli hostages on Saturday and Israeli forces began releasing hundreds of prisoners in return after Egyptian and Qatari mediators helped avert a standoff that threatened to sink a fragile ceasefire in Gaza.