CAIRO (AP) — Israel and Hamas agreed to extend a temporary cease-fire for five days, Egyptian and Palestinian officials said Wednesday, potentially averting renewed violence and permitting the sides to continue to negotiate a substantive deal to end the war in Gaza.
Egyptian mediators had been racing to pin down a long-term cease-fire as a temporary truce was set to expire at midnight.
Egypt’s foreign ministry and the head of the Palestinian negotiating team announced the extension. A spokesman for Israel’s prime minister had no immediate comment.
Yet even as it was announced, violence spiked. Palestinian militants fired five rockets at Israel and Israel responded, targeting sites across the Gaza Strip. It was not clear if the fighting was isolated or might shatter the truce.
The cease-fire extension is meant to grant both sides additional time to negotiate a longer-term truce and a roadmap for the coastal territory.
The lull in violence has also been a welcome reprieve for Israelis and Palestinians living in Gaza. During the temporary cease-fire, Israel halted military operations in the war-battered coastal territory and Gaza militants stopped firing rockets, aside from the ones late Wednesday.
‘‘We have agreed on a cease-fire for five days,’’ said Azzam al-Ahmad, the head of the Palestinian delegation to the Cairo talks. He noted that there had been ‘‘significant progress’’ but that disagreements remained over the wording regarding security arrangements, reconstruction efforts for the Gaza Strip and the permissible fishing area.
The two sides were considering an Egyptian proposal that partially addresses their demands, but deep differences have kept the deal in doubt.
Hamas is seeking an end to a crippling blockade imposed by Israel and Egypt in 2007. The blockade has greatly limited the movement of Palestinians in and out of the territory of 1.8 million people. It has also restricted the flow of goods into Gaza and blocked virtually all exports.
Israel says the closure is necessary to prevent arms smuggling, and officials are reluctant to make any concessions that would allow Hamas to declare victory.
Israel wants Hamas to disarm, or at least be prevented from re-arming. Hamas has recovered from previous rounds of violence with Israel, including a major three-week ground operation in January 2009 and another weeklong air offensive in 2012. It now controls an arsenal of thousands of rockets, some with long ranges and powerful. Gaza militants fired more than 3,000 rockets toward Israel during the war.
Neither side is likely to see all of its demands met, but the Egyptian proposal tabled Tuesday offered some solutions. A member of the Palestinian delegation at the Cairo talks said the proposal calls for easing parts of the Israeli blockade of Gaza, bringing some relief to the territory.
The proposal leaves the key areas of disagreement, including Hamas’ demand for a full lifting of the blockade and Israeli calls for Hamas to disarm, to later negotiations.
The Palestinian negotiator said he had some reservations about the proposal and would try to improve it.
‘‘We would like to see more cross-border freedom, and also to have the question of a Gaza seaport and airport discussed,’’ he said.
The Palestinian official spoke on condition of anonymity because he was not authorized to discuss negotiations with journalists.
As the talks continued, Hamas indicated it was sticking to its demands.
In recorded remarks broadcast on Hamas radio Wednesday, Ismail Haniyeh, the top Hamas leader in Gaza, said that ‘‘achieving a permanent truce can come only through lifting the blockade on Gaza.’’
Israel, meanwhile, signaled it was ready to respond to renewed fire from Gaza following the end of the cease-fire.
‘‘We will continue to defend, continue to operate. We will be ready for any effort, any way, at any time,’’ Israel’s chief of staff, Lt. Gen. Benny Gantz, told reporters.
Amid the cease-fire, an Associated Press video journalist and a freelance Palestinian translator working with him were killed Wednesday when ordnance left over from the war exploded as they reported on the conflict’s aftermath.
Simone Camilli, a 35-year-old Italian, and Ali Shehda Abu Afash, 36, died when an unexploded missile believed to have been dropped in an Israeli airstrike blew up as Gaza police engineers worked to neutralize it in the northern Gaza town of Beit Lahiya. Four police engineers also were killed. Three other people, including AP photographer Hatem Moussa, were badly wounded.
The war began on July 8 with Israel’s air campaign against Gaza’s Hamas rulers, whom Israel blamed for the kidnapping and murder in June of three Israeli teenagers in the West Bank. Nine days later, Israel sent in ground troops to destroy Hamas’ underground cross-border tunnels constructed for attacks inside Israel.
The fighting has so far killed more than 1,900 Palestinians, the majority of them civilians, Palestinian and UN officials say. On the Israeli side, 67 people have died, all but three of them soldiers.
Goldenberg reported from Jerusalem. Associated Press writer Ibrahim Barzak in Gaza City, Gaza Strip, contributed to this report.