Israel-Gaza: Shaky start to ceasefire ending five days of fighting
There are hopes a ceasefire will take hold to end five days of fighting between Israel and Palestinian Islamic Jihad (PIJ) militants in Gaza.
It got off to a shaky start, as both sides kept firing for two hours after the truce started on Saturday evening.
At least 33 Palestinians have been killed since Tuesday in Gaza, where Israel says it has struck PIJ targets.
Palestinian rocket fire into Israel has killed two people, one Israeli and one Palestinian working in the country.
The mediation efforts were led by Egypt, which urged both sides to adhere to the ceasefire agreement.
Washington welcomed the announcement of the ceasefire, and said US officials had worked with regional partners to achieve the resolution.
Barrages of Palestinian rockets set off warning sirens in southern Israel, close to Gaza, and the suburbs of the city of Tel Aviv just before the truce was due to come into effect at 22:00 local time (19:00 GMT) on Saturday.
Minutes after it supposedly started, militants launched more rockets at southern Israeli communities and the Israeli military carried out air strikes on what it said were two PIJ rocket launchers in Gaza.
Further rocket fire at around 23:00 drew another round of air strikes.
Despite the fighting, Israeli Prime Minister Benjamin Netanyahu's office issued a statement confirming that a ceasefire had been agreed and thanked Egypt for its "intensive efforts" to secure one.
It also said Israel had made clear that its acceptance meant "quiet will be met with quiet, and that if Israel is attacked or threatened, it will continue to do everything that it needs to in order to defend itself".
PIJ also confirmed the ceasefire, with a spokesman telling Reuters news agency: "We will abide by it as long as the occupation [Israel] abides by it."
According to a text from Egyptian intelligence seen by the BBC, Palestinian militants and Israel have agreed to stop actions targeting civilians and other individuals.
The BBC's Yolande Knell in Jerusalem says this form of wording appears to cover both the recent intense rocket fire from Gaza and Israel's controversial policy of targeted killings of militant leaders.
Israel began its military operation in Gaza before dawn on Tuesday, killing three leaders of PIJ in their homes as well as at least 10 civilians, including relatives and neighbours of the men.
PIJ fighters then fired barrages of rockets at southern and central Israel, which they said were intended to avenge the dead.
At least 1,234 rockets and mortars have been fired from Gaza in total, with 976 crossing into Israeli territory, according to the Israeli military. Most have been intercepted or have landed in open areas, but some have hit homes and other buildings.
One woman was killed when a rocket hit an apartment building in the central city of Rehovot on Thursday, while a worker from Gaza was killed when he was hit by rocket shrapnel at a building site in the southern Sdot Negev region.
The military says 221 of the rockets have fallen short inside Gaza and that they have killed four people there, including three children. Islamic Jihad denies the allegation.
Israel has carried out air strikes on 371 PIJ targets across Gaza, killing three more leaders and destroying what it said were the group's rocket launch sites and command centres.
About half of the 33 people killed in Gaza were civilians, including seven children and four women, according to local health officials.