Israel and Hamas agreed to a 12-hour cease-fire starting Saturday, temporarily halting more than two weeks of bloodshed that has claimed more than 800 mostly civilian lives.