At least 230 Palestinians and 12 Israelis were killed in the fighting.
Israel and Hamas announced a cease-fire Thursday, ending a bruising 11-day war that caused widespread destruction in the Gaza Strip and brought life in much of Israel to a standstill.
Prime Minister Benjamin Netanyahu's office said Israel accepted the Egyptian proposal after a late-night meeting of his Security Cabinet. Hamas quickly followed suit and said it would honor the deal.
Egypt's state-run MENA news agency said the truce would take effect at 2 a.m., roughly three hours after the announcement.
In a statement, Netanyahu's office said the Security Cabinet unanimously approved the proposal after recommendations from the military chief of staff and other top defense officials. The statement boasted of "significant achievements in the operation, some of which are unprecedented" and included a veiled threat against Hamas.
"The political leaders emphasized that the reality on the ground will determine the future of the campaign," the statement said.
Taher Nounou, a Hamas official, confirmed the deal. "The Palestinian resistance will commit itself to this deal as long as the occupation is committed," he said.
The agreement would close the heaviest round of fighting between the bitter enemies since a 50-day war in 2014, and once again there was no clear winner. Israel inflicted heavy damage on Hamas but was unable to prevent the rocket fire that has disrupted life for millions of Israelis for more than a decade.
The fighting began May 10, when Hamas militants in Gaza fired long-range rockets toward Jerusalem after days of clashes between Palestinian protesters and Israeli police at the Al-Aqsa Mosque compound, a flashpoint site that is known to Muslims as the Noble Sanctuary and to Jews as the Temple Mount. Heavy-handed police tactics at the compound and the threatened eviction of dozens of Palestinian families by Jewish settlers had inflamed tensions.
Israel launched hundreds of airstrikes during the operation, targeting what it said was Hamas' military infrastructure, including a vast tunnel network. Hamas and other militant groups embedded in residential areas fired over 4,000 rockets at Israeli cities, with hundreds falling short and most of the rest intercepted.
At least 230 Palestinians were killed, including 65 children and 39 women, with 1,710 people wounded, according to the Gaza Health Ministry, which does not break the numbers down into fighters and civilians.
Hamas and the militant group Islamic Jihad said at least 20 of their fighters were killed, while Israel said the number was at least 130. Some 58,000 Palestinians have fled their homes, many of them seeking shelter in crowded U.N. schools at a time of a raging coronavirus outbreak.
Twelve people in Israel, including a 5-year-old boy, a 16-year-old girl and a soldier, were also killed.
Since the fighting began, Gaza's infrastructure, already weakened by a 14-year blockade, has rapidly deteriorated.
Medical supplies, water and fuel for electricity are running low in the territory, on which Israel and Egypt imposed the blockade after Hamas seized power in 2007.
Israel considers Hamas, an Islamic militant group that seeks its destruction, to be a terrorist group and Hamas' government is not internationally recognized.
Israeli bombing has damaged over 50 schools across the territory, according to advocacy group Save the Children, completely destroying at least six. While repairs are done, education will be disrupted for nearly 42,000 children.
Israeli attacks have also damaged at least 18 hospitals and clinics and destroyed one health facility, the World Health Organization said. Nearly half of all essential drugs have run out.