Israeli and Palestinian negotiators have agreed to extend a ceasefire in Gaza for another five days after failing to reach a long term agreement in Cairo-mediated talks, Palestinian and Egyptian officials said on Wednesday.

A previously agreed three-day truce was set to expire less than an hour afterwards, at midnight local time (2100 GMT).

"We have agreed to give more time for the negotiations," Azzam al-Ahmed, head of the Palestinian delegation in Cairo said on Wednesday, saying the extra time would be a further five days.

An Egyptian official said Israel also accepted the proposal. Israel had earlier said it would back an extension of the lull.

Earlier on Wednesday, Israeli police said a rocket from Gaza had landed in southern Israeli, hours before the truce was supposed to come to an end, the Reuters news agency reported. However, Hamas denied it was responsible for firing it.

Israel responded, targeting sites across the Gaza Strip. It was not clear if the fighting was isolated or might shatter the truce.

The ceasefire 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 ceasefire, Israel halted military operations in the war-battered coastal territory and Gaza fighters stopped firing rockets, aside from the ones late on Wednesday.

The two sides were considering an Egyptian proposal that partially addresses their demands, but deep differences have kept the deal in doubt.

Sticking points

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.

Neither side is likely to see all of its demands met, but the Egyptian proposal tabled on 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.

Nearly 2,000 Palestinians have been killed since Israel launched its Gaza offensive on July 8 to halt cross-border rocket fire. On the Israeli side, 67 people have been killed, 64 of them soldiers.