A ceasefire between Israel and the Gaza Strip's Hamas rulers brought an end to eight days of the fiercest fighting in years and possibly signalling a new era of relations between the bitter enemies.
The Egyptian-sponsored deal delivered key achievements for all involved. It promised to halt years of Palestinian rocket attacks on southern Israel, ease border closings that have stifled Gaza's economy, and affirmed the emergence of Egypt's new Islamist government as a key player in a changing region.
But vague language in the agreement and deep hostility between the combatants made it far from certain that the bloodshed would end.
News of the truce, announced in Cairo on Wednesday night and reached after furious diplomacy that drew in US, United Nations, European and regional diplomats, set off ecstatic celebrations in Gaza, where thousands poured into the streets, firing guns into the air, honking horns and waving Palestinian, Hamas and Egyptian flags.
In Israel, small demonstrations were held in communities that were struck by rockets. Protesters said the military should have hit Hamas harder and some held signs demanding security and denouncing "agreements with terrorists".
Leaders on both sides used tough language as they prepared to engage in indirect negotiations on a future border arrangement through Egyptian mediators. "I know there are citizens that expected a wider military operation and it could be that it will be needed. But at this time the right thing of the state of Israel is to take this opportunity to reach a continuous ceasefire," Israeli prime minister Benjamin Netanyahu said.
At a news conference in Cairo, the top Hamas leader in exile, Khaled Mashaal, claimed victory, saying the Israelis "failed in their adventure" and was "inevitably destined for defeat".
US secretary of state Hillary Clinton called it "a critical moment for the region". "Egypt's new government is assuming the responsibility and leadership that has long made this country a cornerstone of regional stability and peace," she said.
Israel launched its military offensive in Gaza on November 14 in to halt months of renewed rocket fire from Gaza. In a first salvo, it assassinated the Hamas military chief, then bombarded more than 1,500 targets in eight days of air strikes and artillery attacks. Palestinian militants led by Hamas showered Israel with more than 1,500 rockets, including longer-range weapons that reached as far as Jerusalem and Tel Aviv.
The fighting killed 161 Palestinians, including 71 civilians, and forced hundreds of thousands of people on both sides of the border to remain huddled indoors. Five Israelis were killed.