An Israeli official said late Monday that Jerusalem had accepted an Egyptian proposal for a 72-hour ceasefire with Gaza beginning Tuesday morning, as fighting with Gaza entered its fifth week.

An Egyptian official said representatives of Palestinian factions in Cairo for talks had also approved the truce, set to begin at 8 a.m. Tuesday, and that it may be extended beyond three days.

The Israeli diplomatic official said Israel had agreed to the ceasefire with no preconditions, noting that Prime Minister Benjamin Netanyahu had been waiting until all Hamas tunnels used to infiltrate into Israel had been destroyed, which, according to military officials, was done earlier Monday.

“Israel accepts the wording of the Egyptian ceasefire proposal,” the official said.

The diplomat said Israel would respond if the truce were broken, as past ceasefires have been.

“We are ready for the possibility that the ceasefire will be broken. In that case, we will act accordingly,” the official said.

He added that Netanyahu had made the decision on his own, but informed the cabinet.

The announcement came after a day of talks in Cairo by Palestinian delegations, including from Hamas and Islamic Jihad. Israel had boycotted the meeting, since it does not negotiate with Hamas, a terror group.

“The Palestinians have agreed to a ceasefire proposed by Egypt,” Azzam al-Ahmed, leader of the Palestinian delegation, told reporters in Cairo.

Officials in Egypt and Israel said Jerusalem would send a delegation to Cairo to negotiate a long-term ceasefire, ending 28 days of fighting in Gaza that has left over 1,800 Gazans dead, according to health officials in the Hamas-run Strip. Israel says hundreds of those killed in Gaza were combatants.

64 Israeli soldiers were killed in the fighting, 11 of them by Hamas gunmen emerging from the tunnels dug under the Gaza-Israel border, as well as three civilians.

“Egypt’s contacts with relevant parties have achieved a commitment for a 72-hour truce in Gaza starting from 05:00 GMT tomorrow morning, and an agreement for the rest of the relevant delegations to come to Cairo to conduct further negotiations,” an Egyptian official told AFP.

Israel had accepted an Egyptian ceasefire proposal without preconditions three weeks ago, but Hamas rejected it, instead opting to sue for a more favorable deal with Qatar and Turkey as mediators.

A 72-hour truce announced by the United Nations and the United States late last week ended shortly after it began on Friday morning, after Hamas gunmen attacked Israeli soldiers working to decommission a tunnel, killing three. Hamas claimed that truce had not yet begun.

Israel began pulling troops out of Gaza late Saturday night, as its mission to destroy the network of tunnels used to infiltrate Israel wound down. Netanyahu had said he would not agree to a ceasefire until all tunnels were destroyed.

The military will leave some troops in Gaza during the ceasefire, Israel’s Channel 10 reported.

The Israeli official warned the public to remain vigilant until the truce began. In the past, Israel has seen an uptick in attacks in the hours before a truce, as terrorists take advantage of the time they have before laying down arms.

Israel launched the operation on July 8 to stymie rocket fire and destroy the tunnels. Over 3,200 rockets have been shot at Israel in the past weeks, and Israeli forces have carried out over 4,000 strikes on targets in Gaza during the operation, leading to widespread international condemnation. Netanyahu repeated Monday that Israel had tried not to harm civilians, and that the international community should condemn Hamas for using Gazans as human shields.

He also said the reconstruction of Gaza should be linked to its demilitarization.

AFP contributed to this report.