The cease-fire took effect at 2 a.m. Friday to stop fighting that had devastated large swaths of the Palestinian enclave and sowed chaos in Israel.