Truce agreed to end week of Gaza bloodshed