GAZA CITY, Gaza Strip — Hamas on Sunday agreed to observe a 24-hour humanitarian truce after initially rejecting such an offer by Israel, as fighting resumed and the two sides wrangled over the terms of a lull the international community hopes can be expanded into a more sustainable truce.