Israel and Hamas have agreed to an unconditional 72-hour humanitarian ceasefire in Gaza from 08:00 (05:00 GMT) on Friday.
A joint US and UN statement urged all parties to "act with restraint" until the ceasefire begins. Talks on a more permanent truce are to start in Cairo.
Since Israel began its offensive in Gaza on 8 July, more than 1,420 Palestinians have been killed, most of them civilians, health officials say.
Sixty-one Israeli soldiers have died.
Two Israeli civilians have been killed, as well as a Thai national in Israel.
Israel says its operation in Gaza is designed to defend its population from attacks by Palestinian militants.
'Much needed reprieve'
Officials from both Israel and Hamas, which controls Gaza, confirmed that they had agreed to the ceasefire proposal brokered by the US and UN.
"During this time the forces on the ground will remain in place," US Secretary of State John Kerry and UN Secretary-General Ban Ki-moon said in the joint statement.
Critics of Israel say that its military action has made it impossible for the 1.8 million people of Gaza to find shelter from air and artillery strikes
"We urge all parties to act with restraint until this humanitarian ceasefire begins, and to fully abide by their commitments during the ceasefire," the statement added.
"This ceasefire is critical to giving innocent civilians a much-needed reprieve from violence," the statement went on.
It said that during the ceasefire period, civilians in Gaza would receive "urgently needed humanitarian relief, and the opportunity to carry out vital functions, including burying the dead, taking care of the injured and restocking food supplies".
Israeli and Palestinian delegations will go to Cairo immediately for negotiations with the government of Egypt, at the invitation of Egypt, the statement said, with the aim of reaching "a durable ceasefire".
Israel has released footage of an aborted air strike in response to criticisms of the level of civilian casualties, as Orla Guerin reports
Speaking in India, Kerry warned that a break in the fighting did not guarantee an end to the conflict.
He said that Israel would be able to continue destroying "those tunnels that are behind its lines". Israel says Hamas uses the tunnels to carry out attacks inside Israeli territory.
"This is not a time for congratulations or joy or anything except a serious determination - a focus by everybody to try to figure out the road ahead," Kerry said.
"This is a respite. It is a moment of opportunity, not an end.''
'Rockets within schools'
After days of diplomatic despondency, this is an unforeseen breakthrough, the BBC's UN correspondent Nick Bryant reports from New York.
Qatar and Turkey are reported to have been key to ceasefire efforts as they can communicate with Hamas, which has difficult relations with many other countries.
Early on Friday, before the ceasefire took effect, eight Palestinians were killed by Israeli tank fire in the southern Gaza Strip, AFP news agency reported, citing local officials.
Meanwhile, the Israel Defense Forces (IDF) said that five soldiers were killed by mortar fire near the Gaza border late on Thursday.
UN High Commissioner for Human Rights Navi Pillay has accused both sides of violating the rules of war.
She said Hamas had done so by "locating rockets within schools and hospitals, or even launching these rockets from densely populated areas", while Israel had attacked civilian areas of Gaza such as schools, hospitals, homes and UN facilities.
An attack on a school in the Jabaliya refugee camp on Wednesday morning killed at least 16 displaced civilians, while the shelling of a market near Gaza City on the same day killed 17 people.
The US described the shelling of the school as "totally indefensible" and urged Israel to do more to protect civilian life.
White House spokesman Josh Earnest said there was little doubt that the shells were fired by the Israeli military.
Israel said it would investigate the shelling of the school and apologise if Israeli fire was responsible.
Speaking earlier on Thursday, Israeli Prime Minister Benjamin Netanyahu said the military would continue dismantling Hamas' tunnel network "with or without a ceasefire".
Israel occupied Gaza in the 1967 Middle East war and only 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, water and airspace. Egypt controls Gaza's southern border.