Fighting in Gaza eases after Hamas agrees to ceasefire