Israel and Hamas agreed to a cease-fire Thursday, halting a bruising 11-day war that caused widespread destruction in the Gaza Strip, brought life in much of Israel to a standstill and left more than 200 people dead.
At 2 am local time, just as the ceasefire took effect, frenzy life returned to the streets of Gaza.
People went out of their homes, some shouting Allahu Akbar" or whistling from balconies. Many fired in the air, celebrating the truce.
Like the three previous wars between the bitter enemies, the latest round of fighting ended inconclusively.
Israel claimed to inflict heavy damage on Hamas but once again was unable to halt the militant group's nonstop rocket barrages.
Almost immediately, Israeli Prime Minister Benjamin Netanyahu faced angry accusations from his hard-line, right-wing base that he stopped the operation too soon.
Hamas, the militant group sworn to Israel's destruction, also claimed victory.
But it now faces the daunting challenge of rebuilding in a territory already suffering from poverty, widespread unemployment and a raging coronavirus outbreak.
Netanyahu's office said his Security Cabinet had unanimously accepted an Egyptian cease-fire proposal after recommendations from Israel's military chief and other top security officials.
A statement boasted of significant achievements in the operation, some of which are unprecedented.
It also included a veiled threat against Hamas.
The political leaders emphasised that the reality on the ground will determine the future of the campaign, the statement said.
The fighting erupted on May 10, when Hamas militants in Gaza fired long-range rockets toward Jerusalem.
The barrage came after days of clashes between Palestinian protesters and Israeli police at the Al-Aqsa Mosque compound.
Heavy-handed police tactics at the compound, built on a site holy to Muslims and Jews, and the threatened eviction of dozens of Palestinians by Jewish settlers had inflamed tensions.
The competing claims to Jerusalem lie at the heart of the Israeli-Palestinian conflict and have repeatedly triggered bouts of violence in the past.
Hamas and other militant groups fired over 4,000 rockets into Israel throughout the fighting, launching the projectiles from civilian areas at Israeli cities.
Dozens of projectiles flew as far north as Tel Aviv, the country's bustling commercial and cultural capital.
Israel, meanwhile, carried out hundreds of airstrikes targeting what it said was Hamas' military infrastructure, including a vast tunnel network.
At least 230 Palestinians were killed, including 65 children and 39 women, with 1,710 people wounded, according to the Gaza Health Ministry, which does not break the numbers down into fighters and civilians.
Twelve people in Israel, including a 5-year-old boy and 16-year-old girl, were killed.
The United States, Israel's closest and most important ally, initially backed what it said was Israel's right to self-defense against indiscriminate rocket fire.
But as the fighting dragged on and the death toll mounted, the Americans increasingly pressured Israel to stop the offensive.
In a rare public rift, Netanyahu on Wednesday briefly rebuffed a public call from President Joe Biden to wind things down, appearing determined to inflict maximum damage on Hamas in a war that could help save his political career.
But late Thursday, Netanyahu's office announced the cease-fire agreement. Hamas quickly followed suit.
Militants continued to launch sporadic rocket at Israel early Friday, before the 2 am ceasefire took effect.
In Washington, Biden hailed the cease-fire. I believe we have a genuine opportunity to make progress, and I'm committed to working for it, he said.
Biden said the US was committed to helping Israel replenish its supply of interceptor missiles for its Iron Dome rocket-defense system and to working with the internationally recognized Palestinian Authority not Hamas to provide humanitarian aid to Gaza.
Netanyahu quickly came under heavy criticism from members of his hawkish, nationalist base. Gideon Saar, a former ally who now leads a small party opposed to the prime minister, called the cease-fire embarrassing.
In a potentially damaging development for the Israeli leader, the Palestinian militants claimed Netanyahu had agreed to halt further Israeli actions at the Al Aqsa Mosque and to call off the planned evictions of Palestinians in the nearby Sheikh Jarrah neighbourhood.
An Egyptian official said only that tensions in Jerusalem will be addressed.
He spoke on condition of anonymity because he was discussing behind-the-scenes negotiations and provided no details.
Itamar Ben Gvir, head of the far-right Jewish Power party, tweeted that the cease-fire was a grave surrender to terrorism and the dictates of Hamas.
The cease-fire comes at a sensitive time for Netanyahu.
In the wake of an inconclusive election in March, Netanyahu failed to form a majority coalition in parliament.
His opponents now have until June 2 to form an alternative government of their own.
The war greatly complicated the efforts of his opponents, who include both Jewish and Arab parties and were forced to suspend their negotiations in such a fraught environment.
But the inconclusive outcome of the war could give them renewed momentum to restart those talks.
Meanwhile in Gaza, a Hamas spokesman, Abdelatif al-Qanou, said Israel's announcement was a declaration of defeat.
Nonetheless, the group said it would honour the deal, which was to officially go into effect at 2 am.
Ali Barakeh, an official with Islamic Jihad, a smaller group that fought alongside Hamas, said Israel's declaration of a truce was a defeat for Netanyahu and a victory to the Palestinian people.
Despite the claims, both groups appeared to have suffered significant losses in the fighting.
Hamas and Islamic Jihad said at least 20 of their fighters were killed, while Israel said the number was at least 130 and probably higher.
Some 58,000 Palestinians fled their homes, many of them seeking shelter in crowded United Nations schools at a time of a coronavirus outbreak.
Since the fighting began, Gaza's infrastructure, already weakened by a 14-year blockade, has rapidly deteriorated.
Medical supplies, water and fuel for electricity are running low in the territory, on which Israel and Egypt imposed the blockade after Hamas seized power from the Palestinian Authority in 2007. Since then, Palestinian President Mahmoud Abbas has governed autonomous areas of the Israeli-occupied West Bank and has limited influence in Gaza.
Israeli attacks have also damaged at least 18 hospitals and clinics and destroyed one health facility, the World Health Organization said. Nearly half of all essential drugs have run out.
Israeli bombing has damaged over 50 schools across the territory, according to advocacy group Save the Children, destroying at least six. While repairs are done, education will be disrupted for nearly 42,000 children.