Fighting between Israel and Palestinian militants in the Gaza Strip is currently on hold after both sides agreed to a long-term ceasefire. The past seven weeks have seen the deadliest violence in years, punctuated by a succession of failed truces. Here is a look at what is going on.
Does the truce mean the fighting is now over?
Both sides have agreed to an Egyptian-sponsored deal, which has been painstakingly difficult to arrive at. It is not the first ceasefire since Israel launched its offensive on 8 July - indeed there have been numerous and they have been short-lived.
However, unlike earlier truces which were for intended to last for hours or days, the latest ceasefire is open-ended. After 50 days of fighting, there is more impetus - and war-weariness on both sides - to find a way bring an end to the conflict to a conclusion than at any time before.
What has been agreed?
The ceasefire deal appears to combine elements of proposals that have been under discussion for weeks.
There were however differences in initial statements from both sides.
According to officials from the Palestinian factions, restrictions on Gaza's crossings with Israel would be eased and humanitarian supplies and desperately-needed materials for reconstruction allowed in. Fishing limits will also be extended, they said.
Discussions about other issues, like Hamas' demand for an airport and a sea terminal, will be put off for a month, they added.
A senior Israeli official told the BBC that while Israel accepted the Egyptian ceasefire proposal, it did not include the issue of a seaport, airport or the release of Palestinian prisoners held by Israel.
The official said the two sides would discuss their demands through Egypt within a month.
The ceasefire formula is similar to the one which ended a 2012 conflict between Israel and Hamas - but following a period of relative quiet after that, cross-border fighting started up again.
What is the root of the conflict?
The Gaza Strip, sandwiched between Israel and Egypt, has been a recurring flashpoint in the Israel-Palestinian conflict for years.
Israel occupied Gaza in the 1967 Middle East war and pulled its troops and settlers out in 2005. Israel considered this the end of the occupation, but it still exercises control over most of Gaza's borders, waters and airspace. Egypt controls Gaza's southern border.
Israel has imposed tight restrictions on the movement of goods and people in and out of the Gaza Strip, measures it says are vital for its own security.
However, Palestinians in Gaza feel confined and are suffering socio-economic hardship. The dominant Islamist Palestinian movement Hamas and other militant groups say the restrictions are intolerable.
Hamas's charter is committed to Israel's destruction but in recent years it has said it will consider a long-term truce with Israel. It cites Israel's continued occupation of the West Bank and East Jerusalem as reasons for its attacks on the Jewish state before and after 2005.
It says it is also acting in self-defence against Israeli air strikes, incursions and other military assaults.
What caused the latest escalation?
Rocket fire from militants in Gaza and Israeli air strikes on the territory increased after the abduction and killing of three Israeli teenagers in June, which Israel blamed on Hamas and which led to a crackdown on the group in the West Bank. Hamas denied being behind the killings but later on its political leader Khaled Meshaal said members had carried them out. Tensions rose further after the suspected revenge killing of a Palestinian teenager in Jerusalem on 2 July, after which six Jewish suspects were arrested.
On 7 July, Hamas claimed responsibility for firing rockets for the first time in 20 months, after a series of Israeli air strikes in which several members of its armed wing were killed.
The next day, Israel launched Operation Protective Edge, which it said was aimed at stopping rocket attacks and destroying Hamas' capabilities.
Since then, there have been thousands of air strikes and thousands of rockets have been fired.
Analysts point to the fact that Hamas has become increasingly isolated in Gaza after losing the support of its former staunch ally Syria and to a lesser extent Iran, and seeing the Egyptian authorities crack down on smuggling tunnels following the overthrow of Islamist President Mohammed Morsi. Attacking Israel, they say, may be a way for Hamas to try to boost its popularity and obtain concessions in any eventual long-term ceasefire.
Why has it been so hard to get the sides to agree to a long-term ceasefire?
There have been multiple efforts to get both sides to agree to a ceasefire, but truces have been short-lived.
The first truce plan was proposed by Egypt after one week - Israel accepted it but Hamas said it was not consulted and later on rejected it as "a surrender".
There were several attempts to stop the fighting over the following weeks, including trying to achieve pauses for humanitarian reasons. There were brief respites but none which endured. Israel says it accepted successive truce proposals but resumed fire after renewed rocket attacks from militants.
Hamas said it would accept a lasting ceasefire so long as it led to a lifting of the blockade of Gaza - something Israel insisted it would not consider without the demilitarisation of Gaza.
Meanwhile, Israel said it would not negotiate while under fire, and withdrew from ceasefire talks in Egypt when rocket fire resumed.
What are the two sides' goals?
Israel's main declared aim is to stop rocket fire from Gaza once and for all and restore quiet and safety for Israelis. Part of its Operation Protective Edge involved a ground operation to destroy Hamas tunnels, which have been used to launch attacks into Israel. Israel says it destroyed 32 but acknowledge some may have gone undetected.
Israel has also made it clear that it wants Gaza to be demilitarised.
Hamas' political leaders said they would only stop fighting when there is an end to the blockade of Gaza. The group's armed wing though went further, demanding an end to Israeli "aggression" in the West Bank, Jerusalem and Gaza and the freeing of prisoners released in exchange for Gilad Shalit in 2011 but were recently re-arrested.
How come civilians have borne the brunt?
Gaza is a small territory with a large population and Palestinian officials say many of the casualties were caused by air strikes in residential areas. President Mahmoud Abbas has accused Israel of committing "genocide" while human rights groups have warned Israel that air strikes in densely populated areas or direct attacks on civilian homes could violate international law.
Israel has said the homes it has bombed belonged to senior militants and served as command centres where rocket attacks were co-ordinated. It says militants deliberately fire rockets from civilian areas and store rockets in places like homes, school and hospitals - a charge Hamas denies.
Israel also points out that the hundreds of unguided rockets that have been fired at its territory directly threaten its civilians.
Long-range rockets have been launched towards population centres such as Tel Aviv and Jerusalem, as well as further north. Human rights groups have said the firing of indiscriminate rockets endangers civilians and constitutes a war crime.
The two sides have fought wars before. How did they end?
The latest fighting has lasted far longer than the previous Israel-Gaza conflicts in 2008-09 and 2012.
Israel launched a ground offensive in December 2008 dubbed Operation Cast Lead in response to rocket fire. It ended when Israel declared a unilateral ceasefire 22 days later, saying its goals were "more than fully achieved". An estimated 1,300 Palestinians were killed, many of them civilians. Thirteen Israelis also died, including four soldiers in a "friendly fire" incident. Gaza's civilian infrastructure was damaged extensively.
Four years later, Israel launched Operation Pillar of Defence, again with the stated goal of stopping rocket fire and crippling Hamas's capability to launch attacks. Eight days into the operation, Egypt brokered a ceasefire agreement that included a promise from both sides to stop attacks. At least 167 Palestinians and six Israelis were killed.