Warring parties in the Gaza Strip agreed to extend their cease-fire by five more days, negotiators announced late Wednesday, moments before a previous truce was due to expire. But the brinkmanship — and a brief flare-up of hostilities — suggested that reaching a durable accord could be a difficult task.

Palestinian spokesman Azzam Ahmad, at a news conference in Cairo, said he hoped that a permanent end to the hostilities could be negotiated during the five-day extension. He blamed Israel for delays in reaching an accord, but said indirect talks so far had produced broad agreement on a number of points. Hamas official Izzat Rishq also confirmed the new truce.

Israel had indicated that it did not object to prolonging the cease-fire, but it did not immediately comment on its extension. Even as the new temporary accord was announced in the Egyptian capital, the Israeli military said it was targeting “terrorist sites” across Gaza in retaliation for a volley of rockets launched shortly before the previous cease-fire expired at midnight.

The Israeli military denounced “Gaza terrorists” for the rocket fire but did not specifically blame Hamas, the militant group with which it has fought a monthlong war. A Hamas spokesman, Sami abu Zuhri, said the group was not responsible.

Up until the deadline, both sides had seemed to be preparing for the possibility that hostilities would resume. The Israeli military reinforced its troops along the border with Gaza before the deadline, and Israeli news reports said that the army had put a number of units on alert for possible deployment.

Lefteris Pitarakis / Associated Press

Associated Press video journalist Simone Camilli was among five people killed Aug. 13 when an Israeli shell detonated as a team of bomb-disposal experts tried to dismantle it in the northern Gaza town of Beit Lahiya.

Associated Press video journalist Simone Camilli was among five people killed Aug. 13 when an Israeli shell detonated as a team of bomb-disposal experts tried to dismantle it in the northern Gaza town of Beit Lahiya. (Lefteris Pitarakis / Associated Press)

The White House said President Obama had spoken with Israeli Prime Minister Benjamin Netanyahu as the deadline was approaching.

Gaza had been largely calm since the start of the previous, three-day truce, but the continuing danger was starkly illustrated when what was believed to have been an unexploded missile left over from the fighting blew up as Gaza police engineers were trying to defuse it. An Associated Press video journalist, Italian national Simone Camilli, and freelance Palestinian interpreter Ali Shehda abu Afash were killed, the news agency said, along with four police engineers.

Scenes from the devastating war in the Gaza Strip between Israel and the militant group Hamas in 2014.

A series of tweeted pictures from Gaza have called attention to the danger posed by dozens of live Israeli munitions strewn in the streets. Previous Israeli assaults also left considerable amounts of unexploded munitions that were eventually destroyed by explosives and demining experts.

Netanyahu, meanwhile, spoke dismissively of a commission set up by the United Nations Human Rights Council to investigate Israel on suspicion of war crimes, suggesting that the panel members instead visit Syria, Iraq and Libya, and meet with militants of Islamic State and Hamas.

“That’s where they’ll find war crimes,” he said. “Not here.”

During a month of fighting, Israel came under withering international criticism over its use of battlefield weapons in densely populated areas of Gaza. More than 1,900 Palestinians have been killed, with human rights groups and the U.N. saying most were civilians. Sixty-seven Israelis, all but three of them soldiers, have died in the third war in six years between the two sides in Gaza.

Ahmad, the Palestinian spokesman, said issues such as security, the lifting of a seven-year blockade of Gaza and the role of the United Nations and the international community to back new arrangements remained to be discussed.

“There is progress for an agreement on many points,” he said.

Ahmad said his negotiating team was leaving for the West Bank to consult with Palestinian Authority President Mahmoud Abbas. Since the indirect negotiations began, delegations from the two sides have made frequent trips to and from Cairo.

Times staff writer King reported from Cairo and special correspondent Sobelman from Jerusalem. Special correspondents Maher Abukhater in Ramallah, West Bank, and Amro Hassan in Cairo contributed to this report.

For more news about Israel and the Gaza Strip, follow @laurakingLAT on Twitter