Israel and the militant Islamic Jihad group have reached a ceasefire to end the heaviest Gaza fighting in months that killed at least 34 Palestinians, including eight children, and paralysed parts of Israel.

Islamic Jihad spokesman Musab al-Berim said the Egyptian-brokered deal came into effect at 5.30am on Thursday. An Israeli military spokesman tweeted that the Gaza operation “is over”.

Some restrictions were lifted on residents of southern Israel and traffic returned to the streets of the Palestinian coastal territory.

Despite the ceasefire, Gaza militants fired a barrage of rockets into Israel hours later. Air raid sirens went off in several communities near the Gaza Strip.

Israel Palestinians
Palestinians check the damage of a house targeted by Israeli missiles in Gaza City (Khalil Hamra/AP)

Israel hailed the operation as a victory, defending its policy of targeting militants in their homes despite civilian deaths, while Islamic Jihad said it had got Israel to agree to cease fire based on several demands, including a halt to Israel’s targeted killings of the group’s leaders.

Israeli military spokesman Lieutenant Colonel Avichay Adraee did not confirm any such deal, listing on Twitter only Israeli accomplishments in the fighting, while Israel’s foreign minister said targeted killings of militants would continue.

The fighting broke out early on Tuesday after Israel killed a senior commander of the Iranian-backed militant group who was said to have been behind a string of rocket attacks and who Israel said was believed to be planning a cross-border infiltration.

The rare targeted killing by Israel sparked the heaviest fighting with Gaza militants since May. Islamic Jihad fired 450 rockets towards Israel, which responded with scores of air strikes.

Israel Palestinians
Israeli police remove a rocket fired from the Gaza Strip (Tsafrir Abayov/AP)

Gaza’s ruling Hamas militant group, which is much larger and more powerful than Islamic Jihad, stayed out of the latest escalation — an indication that it would be brief.

Israeli foreign minister Israel Katz said the policy of targeted killings had “proved itself” and would continue.

“Everyone who was a top military official, who was set to carry out and was involved in terror or rocket firing against Israel was eliminated,” he told Israeli Army Radio. “And we intend to continue with this.”

Israel Palestinians
A factory hit by a rocket in Sderot, southern Israel (Tsafrir Abayov/AP)

Defence minister Naftali Bennett warned Gaza militants they were not safe anywhere.

“A terrorist who tries to harm Israeli citizens will not be able to sleep soundly, not in his home and not in his bed and not in any hiding place,” he said, according to a statement.

Military spokesman Lieutenant Colonel Jonathan Conricus said at least 23 militants were struck, and defended attacks on their private homes, saying Islamic Jihad commanders used their residences to store weapons, making them legitimate targets.

Palestinian officials said 34 people were killed, including at least 18 militants. They said eight children, including a pair of seven-year-olds, and three women were among the dead.

Israel Palestinians
Mourners carry the body of Islamic Jihad militant Abdullah Al-Belbesi (Khalil Hamra/AP)

The rocket fire crippled life across southern Israel and in the country’s heartland in and around Tel Aviv, as non-stop air-raid sirens cancelled school and forced people to remain indoors.

At least three people were lightly wounded from shrapnel or shattered glass. Most rockets landed in open areas or were shot down by Israel’s Iron Dome missile defence system.

Much of Gaza resembled a ghost-town, with almost no vehicles on the roads except for ambulances evacuating the wounded.

Shortly after Mr al-Berim’s announcement, at least five rockets were fired out of Gaza, setting off sirens in southern Israel. It was not immediately clear who fired the rockets or whether the launches were intentional or misfires.

But Islamic Jihad said it was committed to ending the fighting, adding the fire was likely because word had not spread to all members about the halt to violence.