A cacophony of cheers, ululations and celebratory gunfire filled Gaza's streets, as elated residents welcomed news of a ceasefire ending a bloody 50-day war with Israel.
As the truce went into effect on Tuesday night, hordes of people surged onto the streets, clapping and chanting songs of victory as a man swathed in a huge green Hamas flag threw handfuls of sweets into the air.
Traffic packed out Gaza's cities. Hundreds of vehicles careered around tooting horns, with flags of Palestinian factions attached - the green of Hamas, the black and white of Islamic Jihad and the yellow of Fatah. Mosques used their loudspeakers to broadcast celebratory chants of "God is great" as the enclave hailed the apparent end to seven weeks of war that has seen a quarter of its 1.8 million people flee their homes.
Watch: Celebrations in Gaza as long-term truce begins
The agreement involves an immediate halt to the violence in Gaza that broke out on July 8 and has claimed the lives of 2,143 Palestinians and 69 on the Israeli side. The Palestinians said it was a "permanent" truce, while a senior Israeli official described it as "unconditional and unlimited in time".
Washington gave its full backing to the deal. "We strongly support today's ceasefire agreement," Secretary of State John Kerry said, calling on "all parties to fully and completely comply with its terms".
UN Secretary General Ban Ki-moon voiced hope that the ceasefire in Gaza would set the stage for talks on a final Israeli-Palestinian peace deal.
The chief Palestinian truce negotiator, Azzam al-Ahmed, said the deal involved a "permanent ceasefire" and easing Israel's eight-year blockade of Gaza, in a move hailed by Hamas as a "victory for the resistance".
At a later, unspecified date, the two sides would discuss "the exchange of [Palestinian] prisoners and of the bodies of those [Israeli soldiers] killed" during the conflict, he said.
Israel confirmed the negotiating teams would return to Cairo "within a month", without saying when.
At a UN school in Gaza City, used like scores of others as a shelter for thousands of displaced, Rewa Shamali ululated along with dozens of other women and their families. "I'm so happy today, like everyone, because the resistance succeeded in imposing their demands on the Israelis," she said, explaining how she had come to the school with 30 relatives after their homes were shelled by Israel. "This victory makes us forget our destroyed homes, our displacement."
Others agreed the truce was a victory for Hamas.
Ibrahim, an armed militant, held his Kalashnikov rifle in the air defiantly. "We achieved a lot in this war, imposing our demands on one of the most powerful armies in the world," he declared, but warning they were ready if fresh fighting resumed.
"We're ready, if necessary, for a second round."
"Thank God! The resistance won!" said Tamer al-Madqa, 23. "Today Gaza showed the world that it is resisting and that it is stronger than Israel."
Militants emerged from hiding for the first time in weeks, firing shots into the air in celebration and crying, "Allahu Akbar [God is great]".
One pickup truck cruised by with around 20 people packed into it, standing in the back or on the roof of the cab, waving flags and showing the victory sign.
As night fell, there was no let-up in the celebrations, with masked gunmen in military fatigues firing into the air and drums beating a celebratory note through the crowded streets.
Mohammed Badir, 20, was also celebrating but he paid tribute, too, to the memory of the huge number of dead and wounded in the seven weeks of fighting. "It's the festival of victory, but we won't forget the blood of the martyrs, the wounded or the homeless, all in their thousands," he said.