THE Israeli military has lifted protective restrictions on residents in the south, while Gaza's ruling Hamas militant group reported a ceasefire had been agreed to end the deadliest fighting between the two sides since a 2014 war.

The escalation had killed 25 on the Gaza side, both militants and civilians, while on the Israeli side four civilians were killed by incoming fire.

The Islamic Jihad militant group, which Israel accused of instigating the latest violence, confirmed that a "mutual and concurrent" truce had been brokered by Egypt.

Hamas spokesman Hazem Qassem said Egyptian mediators, along with officials from Qatar and the UN, helped reach the deal. He said Hamas could still use "different pressuring tools" to get Israel to ease a crippling blockade of Gaza.

Israeli prime minister Benjamin Netanyahu said: "The campaign is not over, and it requires patience and judgment."

The intense fighting over the past two days came to a halt early on Monday and residents on both sides went back to their daily routines. Schools and roads had been closed, and Israelis had been urged to remain indoors and near bomb shelters as intense rocket fire pounded the area.

Israel and Hamas have fought three wars and numerous smaller battles since the Islamic militant group seized Gaza from Western-backed Palestinian forces in 2007.

In the latest fighting, Palestinian militants fired hundreds of rockets into Israel, while the Israeli military responded with air strikes on 350 militant targets inside Gaza, including weapons storage, attack tunnels and rocket launching and production facilities.

It also deployed tanks and infantry forces to the Gaza frontier, and put another brigade on standby. A Hamas commander allegedly involved in transferring Iranian funds to the group was killed in an air strike, in an apparent return to Israel's policy of targeting militant leaders.

Palestinian medical officials reported 25 deaths, including at least 10 militants as well as three women, two of them pregnant, and two babies.

The four Israeli civilians killed were the first Israeli fatalities from rocket attacks since the 50-day war in 2014. One was killed when his vehicle was hit by a Kornet anti-tank missile near the Gaza border.

The Gaza public works ministry said 130 housing units were destroyed in Israeli air strikes, including a five-storey building in the northern Gaza Strip where six people, including a 12-year-old boy and an infant, were killed.

Egyptian mediators had been working with the UN to broker a ceasefire. Under past Egyptian-brokered deals, Israel agreed to ease its joint blockade of Gaza with Egypt in exchange for a halt to rocket fire.

The latest fighting broke out after Palestinian militants accused Israel of not honouring an earlier ceasefire deal from March and opened fire on soldiers on the Israeli side of the Gaza frontier.

The terms of the latest deal were not known, but recent ceasefires have been short-lived.