Mediators worked against the clock on Thursday to extend a truce between Israel and Palestinian militants in the Gaza Strip, as the three-day ceasefire entered its final hours.

Israel said it was ready to agree to an extension as Egyptian go-betweens pursued talks with Israeli and Palestinian delegates in Cairo on ending a war that has devastated the Hamas-controlled enclave.

Palestinians want an Israeli-Egyptian blockade on Gaza lifted and prisoners held by Israel to be freed. Hamas's armed wing said it was ready to resume fighting unless Palestinian demands were met, and Israel said it would respond forcefully if attacked.

"Indirect talks are ongoing and we still have today to secure this," an Egyptian official said when asked whether the truce was likely to go beyond Friday's 8 a.m. local time deadline.

"Egypt's aims are to stabilize and extend the truce with the agreement of both sides and to begin negotiations towards a permanent agreement to cease fire and ease border restrictions."

The Palestinian delegation met Egyptian intelligence officials late on Thursday. Israeli officials said Israel's delegates would return to Cairo in the evening having briefly returned home to confer with Prime Minister Benjamin Netanyahu.

After a month of bitter battles, the two sides are not talking face to face.

Gaza officials say the war has killed 1,875 Palestinians, most of them civilians. Hamas said on Thursday it had executed an unspecified number of Palestinians as Israeli spies.

Israel says 64 of its soldiers and three civilians have died in the fighting that began on July 8, after a surge in Palestinian rocket salvoes into Israel.

An Israeli official said late on Wednesday that Israel "has expressed its readiness to extend the truce under its current terms" beyond Friday morning's expiry of the three-day deal, which took effect on Tuesday and has so far held.

A senior Israeli minister, Yaakov Peri, said on Army Radio that an extension would be "right for both sides" and added: "Let's hope that reason prevails."

'We are ready to enter the battle anew,' Hamas says

In Gaza, Palestinian factions held a rally, with several thousand supporters urging Hamas to "bomb Tel Aviv".

Mushir Al-Masri, a Hamas official, told the crowd that Israel should know that "our fighters are in the battlefield with their fingers on triggers".

Hamas's armed wing called on Palestinian negotiators to quit the talks in Cairo unless progress were made towards meeting the group's demands, which include opening Gaza's seaport.

"We urge the Palestinian delegation negotiating not to renew the truce except after the acceptance in principle, particularly to establish the seaport, and if there is no acceptance then we ask the delegation to withdraw from talks," the armed wing's spokesman, Abu Ubaida, said in a televised statement.

"We are ready to enter the battle anew and we will give the occupation a difficult decision to make: either we will bring them into a long war of attrition or we will draw them into a broad territorial war," he added, threatening attacks he said would paralyze the Israeli economy and shut down Ben Gurion International Airport near Tel Aviv.

A Hamas refusal to extend the ceasefire could further alienate Egypt, whose government has been hostile to the group and which ultimately controls Gaza's main gateway to the world, the Rafah border crossing.

Israel's military chief, Lt.-Gen. Benny Gantz, said that if Hamas broke the truce, Israel would use "whatever force necessary to ensure the security of Israeli citizens".

A senior Israeli military officer, briefing foreign reporters, said Hamas was capable of resuming attacks with its remaining rockets but it could take "months" for guerrillas to replenish their arsenal from domestic production facilities battered by Israel's assault.

"They started with around 9,000 rockets (in their total arsenal) and now they have a bit less than 3,000," the officer said. "The majority are short-range, less than 40 kilometres."

Israel's central bank governor, Karnit Flug, put the war damage to the Israeli economy at $1.44 billion and Finance Minister Yair Lapid said the 2014 budget could absorb the cost of the conflict without raising taxes. But the Fitch ratings agency said budget planning next year might reflect the need to reverse recent falls in defence spending.

Israel withdraws ground troops

Israel withdrew ground forces from Gaza on Tuesday, shortly before the truce began. There were signs it expected the quiet to last, as emergency restrictions on civilians living near Gaza in Israel's south were lifted to permit more public activities. Residents were urged to resume their routines.

The Israelis described the ceasefire as a tradeoff of "calm for calm". They have shown little interest in easing their naval blockade of Gaza and controls on overland traffic and airspace, worrying Hamas could restock on weapons from abroad.

'Indirect talks are ongoing and we still have today to secure this.'- An Egyptian official

In Gaza, where half a million people have been displaced by a month of bloodshed, some residents left United Nations shelters to return to neighbourhoods devastated by Israeli shelling.

U.S. President Barack Obama, backing efforts to broker a durable ceasefire, called for a longer-term solution that provides Israel with security while offering Gaza residents hope they will not be permanently cut off from the world.

While condemning Hamas for launching rockets against Israel from population centres, Obama urged an eventual formula to ease the hardships of ordinary Palestinians.

Efforts to achieve a lasting truce could prove difficult, with the sides far apart on their central demands, and each rejecting the other's legitimacy. Islamist Hamas calls for the Jewish state's destruction, while Israel denounces Hamas as a terrorist group and refuses any direct contact.

To encourage thoughtful and respectful conversations, first and last names will appear with each submission to CBC/Radio-Canada's online communities (except in children and youth-oriented communities). Pseudonyms will no longer be permitted.

By submitting a comment, you accept that CBC has the right to reproduce and publish that comment in whole or in part, in any manner CBC chooses. Please note that CBC does not endorse the opinions expressed in comments. Comments on this story are moderated according to our Submission Guidelines. Comments are welcome while open. We reserve the right to close comments at any time.

Note: The CBC does not necessarily endorse any of the views posted. By submitting your comments, you acknowledge that CBC has the right to reproduce, broadcast and publicize those comments or any part thereof in any manner whatsoever. Please note that comments are moderated and published according to our submission guidelines.