The Israeli military had said the ceasefire would last between 15:00 (12:00 GMT) and 19:00.

However, it had warned that the truce would only apply to areas where Israeli soldiers were not currently operating, and it told residents not to return to areas they had previously been asked to evacuate.

Image copyrightReutersImage caption
A mosque in the southern Gaza Strip collapses after an explosion

"The lull which Israel announced is media exploitation and has no value because it excludes the volatile areas along the border, and we won't be able to get the wounded out from those areas," he said in a statement.

Sirens continued to sound in southern Israel after the ceasefire, to warn of militant rocket attacks.

Israel said more than 50 rockets were fired from Gaza on Wednesday.

The UN had earlier expressed outrage at the attack on the school in the Jabaliya refugee camp.

Spokesman Chris Gunness told the BBC that Israel had been told 17 times that the school was housing the displaced, saying the attack caused "universal shame".

Secretary General Ban Ki-moon later said the attack was "reprehensible, unjustifiable, and demands accountability and justice".

The Israeli military said in a statement that its "initial inquiry suggests militants fired mortars... from the vicinity of the school in Jabaliya".

It said soldiers had "responded by firing towards the origin of fire".

Longest conflict

Israel launched its offensive in Gaza after a surge in rocket fire from the territory.

Media playback is unsupported on your device

Media captionChris Gunness: "Children were killed as they slept next to their parents"

Media playback is unsupported on your device

Media captionThe BBC's Orla Guerin was given access by the Israeli military to a tunnel they say was used by Palestinian militants

It says one of its main objectives is to destroy tunnels used by militants to infiltrate Israel.

Army spokesman Sami Turgeman said on Wednesday that this mission "will be completed within a number of days".

Hamas says it will not stop fighting until a blockade, maintained by both Israel and Egypt, is lifted.

The current conflict, now in its 23rd day, is the longest between Israel and militants from Gaza.

A 2012 offensive lasted for eight days, and the 2008 conflict went on for 22 days.