Israel and the Palestinians agreed to a fresh 72-hour ceasefire in Gaza on Sunday, accepting an Egyptian invitation to resume talks to end fighting that has killed more than 2,000 people.
The ceasefire deal, which was to come into effect at one minute past midnight (2101 GMT on Sunday), clinched days of frantic mediation to stem a firestorm of violence that resumed after an earlier truce collapsed on Friday.
"Israel has accepted the Egyptian proposal for a ceasefire," an official told AFP shortly after a Palestinian source confirmed accepting the initiative.
The Egyptian foreign ministry called for the ceasefire to begin at 00:01 local time (21:01 GMT Sunday) "given the necessity to protect innocent blood".
It called on both sides to use the lull to "reach a comprehensive and permanent ceasefire."
Israel had bolted truce talks in Cairo on Friday when Hamas refused to extend an earlier ceasefire and begun firing rockets over the border.
More than a month of bloody fighting in and around Gaza has killed at least 1,939 Palestinians and 67 people on the Israeli side, most of them soldiers.
The UN says just under three quarters of those killed in Gaza were civilians, and around a third of the civilian victims were children.
On the ground, eight Palestinians were killed, including a woman and two 17-year-olds, in a barrage of Israeli air strikes and 10 bodies were pulled from the rubble east of Gaza City, local medics said.
Throughout the day, Israeli warplanes hit 41 targets, including a factory in Gaza City used to make cleaning products close to the main hotel where foreign journalists are based.
Militants launched 35 rockets over the border, 23 of which struck southern Israel and eight which were shot down, with the rest falling short inside Palestinian territory, the army said.
Rockets close commercial crossing
In Deir al-Balah, an angry crowd of young men bellowed slogans as they carried the bloodied body of one of the teenagers to its burial side.
The army described the youth as a "prominent terror operative".
"God loves martyrs! We will march on Jerusalem in our millions," chanted mourners.
At the graveside, neighbours passed around pieces of shrapnel as he was laid to rest in a plot where several other freshly-dug graves laid open, as if prepared for further deaths.
Gaza plunged back into an abyss of violence after a 72-hour truce ended on Friday, with the Israeli military hitting more than 160 targets and killing at least 19 people, and Palestinian militants launching 110 rockets of which 85 smashed into Israel.
Israel said it had been forced to close its Kerem Shalom crossing used to truck supplies into the southern Gaza Strip after it was struck twice by rocket fire. "After continuous and intentional rocket fire at the Kerem Shalom crossing this morning and this afternoon, during which trucks carrying flammable materials to the Gaza Strip were almost hit, we took the exceptional decision to close the crossing in order to protect the lives of workers and traders," a defence ministry statement said.
For days, Egyptian efforts to broker an end to more than a month of fighting led nowhere.
"Israel will not engage in negotiations under fire," Prime Minister Benjamin Netanyahu told his cabinet on Sunday, warning the operation would not stop until there was a prolonged quiet.
In the West Bank, an 11-year-old Palestinian boy was shot dead by Israeli troops as he played outside his home in Al-Fawwar refugee camp near the southern city of Hebron, relatives and medics said.
The army said troops had opened fire during a "violent riot" but said it had opened an investigation into the circumstances of the shooting.
Israel's Gaza operation has triggered a series of almost daily protests across the West Bank, during which 16 Palestinians have been killed, the Ramallah-based health ministry said.
Read: America's helping hand in Iraq, blind eye to Gaza
The resumption of fighting has put Netanyahu under increased pressure from hardliners to send ground troops back in to Gaza to topple Hamas, the de facto power in the battered Palestinian enclave.
"There is no doubt that the only thing left to do now is to overpower Hamas, clean out the territory and get out as quickly as possible," said foreign minister Avigdor Lieberman.
Public security minister Yitzhak Aharonovitch said that if talks to secure a permanent ceasefire led nowhere, going back in to Gaza would be the only option.
"The moment the door closes and negotiations do not bear any fruit and we are faced with continued fire... there will apparently be no choice, and then we will go in," he told public radio.
HT Analysis: Attack on Gaza: Israel wins, the world loses