Gaza’s militant Hamas rulers said they have accepted a ceasefire ending an Israeli onslaught on militant positions after a soldier was shot dead.

Hamas spokesman Fawzi Barhoum said it accepted the ceasefire brokered by Egyptian and United Nations officials and that calm had been restored.

The Israeli military destroyed more than 60 Hamas targets on Friday, including three battalion headquarters.

Gaza protests
Protesters gather while burning tyres near the fence of the Gaza Strip’s border with Israel (Adel Hana/AP)

The massive air strikes, which killed four Palestinians, came after a Palestinian sniper killed an Israeli soldier along the border.

Hamas said three of the Palestinian casualties were its members.

The second such ceasefire in a week after fierce exchanges seemed to once more pull the sides back from the brink of a full-fledged war.

Israel and Hamas have fought three wars over the past decade.

“The attack delivered a severe blow to Hamas’s training array, command and control abilities, weaponry, aerial defence and logistic capabilities along with additional military infrastructure,” the Israeli military said in a statement.

The recent outburst of violence comes after months of near-weekly border protests organised by Hamas aimed in part at protesting against the Israeli-Egyptian blockade of Gaza.

More than 130 Palestinians have been killed by Israeli fire since the protests began on March 30.

Israel and Egypt have maintained a blockade on Gaza for more than a decade in an attempt to weaken Hamas.

The blockade has caused widespread economic hardship. Israel says the naval blockade is necessary to protect its citizens from weapons smuggling.

Israel says it is defending its sovereign border and accuses Hamas of using the protests as cover for attempts to breach the border fence and attack Israeli civilians and soldiers.