When the fighting halted, the celebrations began.
Unable last week to celebrate Eid al-Fitr, the joyous Muslim feast marking the end of the Ramadan fasting month, many Gazans took to the street at 2 a.m. on Friday to extol the start of a Hamas truce with Israel that ended 11 days of hostilities.
"God is greatest and thanks to God," they shouted in Arabic.
Cars packed Gaza's main streets, drivers honking their horns and waving flags from the windows, in scenes reminiscent of past celebrations of truces and prisoner releases.
Hamas, the Islamist militant group that rules Gaza, cast the fighting as successful resistance of a militarily and economically stronger foe.
Mosque loudspeakers hailed what they called "the victory the resistance achieved over the occupation during the battle of the Sword of Jerusalem." Men fired rifles into the air, and others set off noise bombs or firecrackers.
Gaza health officials said 232 Palestinians, including 65 children, were killed and more than 1,900 wounded in Israeli air strikes and artillery bombardments. Israel said it had killed at least 160 combatants.
Authorities put the death toll in Israel at 12, with hundreds of people treated for injuries in rocket attacks that caused panic and sent people rushing into shelters.
In Tel Al-Hawa in Gaza City people said they were celebrating their safety, and what they viewed as their victory. Some hugged, one calling it a "time out from the coronavirus."
"With souls and blood, we redeem you, Deif," they chanted, calling out the name of Hamas's top military commander Deif, who tops Israel's wanted list.
"This is a great victory over the occupation. Our resistance men forced them to the ceasefire," said Ahmed Amer, 30, as he celebrated with his friends.
"Today is when Eid al-Fitr begins. Yes, we are sorry and sad for our people who lost their houses and their relatives, but despite that, we will celebrate," Amer said.
Another man clutching an AK-47 assault rifle said: "Our fingers are on the triggers, and we are ready to fight again, but now we will celebrate with our people," he said, refusing to give a name.
In the Israeli-occupied city of Ramallah, hundreds of people took to the streets chanting: "With souls and blood we redeem you, Gaza."
Fireworks were set off in Sheikh Jarrah, the East Jerusalem neighbourhood where a long-running legal battle by Palestinian families to stop their forced eviction by Israeli settlers was a key factor in mobilising protesters across the Old City and farther afield during Ramadan.