A tense calm held across Israel and Gaza on Monday after Palestinian officials announced a ceasefire deal had been reached, apparently ending one of the deadliest flare-ups of violence since the last war in 2014.

Three officials from Gaza’s armed factions and sources in Egypt said that Cairo had brokered the truce after nearly 30 people were killed and hundreds were injured since cross-border fire erupted on Saturday morning.

The Israeli army, which declined to confirm the peace deal, said that “all protective restrictions in the home front will be lifted”, implying the fighting had ended.

Israel's prime minister Benjamin Netanyahu meanwile warned that "the campaign is not over... We are prepared to continue."

For 36 hours, hundreds of rockets rained down on the south of Israel and airstrikes pounded Gaza prompting fears both sides were on the brink of a protracted war.

In Gaza, 25 Palestinians were killed, including two pregnant women and two children, after Israel struck over 350 targets in the besieged Strip.

Worst violence in Gaza for years leads to ceasefire: in pictures Show all 14 1 /14 Worst violence in Gaza for years leads to ceasefire: in pictures Worst violence in Gaza for years leads to ceasefire: in pictures An Israeli airstrike hits Rafah in the Gaza Strip on 5 May AFP/Getty Worst violence in Gaza for years leads to ceasefire: in pictures Rockets are fired from Gaza towards Israel on 5 May Reuters Worst violence in Gaza for years leads to ceasefire: in pictures People run inside a building in Gaza that was hit by an Israeli airstrike Reuters Worst violence in Gaza for years leads to ceasefire: in pictures Paramedics carry an injured boy outside a hospital in Gaza on 5 May AFP/Getty Worst violence in Gaza for years leads to ceasefire: in pictures Smoke billows from a site in Gaza targeted by Israeli airstrikes on 5 May AFP/Getty Worst violence in Gaza for years leads to ceasefire: in pictures The remains of a building in Gaza City that was hit by Israeli airstrikes on 5 May AFP/Getty Worst violence in Gaza for years leads to ceasefire: in pictures A Palestinian family waits for help inside an ambulance on the Gaza strip following Israeli airstrikes AFP/Getty Worst violence in Gaza for years leads to ceasefire: in pictures People react as they inspect a building in Gaza that was hit in an Israeli air strike on 5 May Reuters Worst violence in Gaza for years leads to ceasefire: in pictures A member of Palestinian Civil Defence extinguishes a fire in the car of a Hamas commander who was killed in an Israeli air strike in Gaza City on 5 May Reuters Worst violence in Gaza for years leads to ceasefire: in pictures A Palestinian missile is intercepted by Israel's Iron Dome air defence system on 5 May AFP/Getty Worst violence in Gaza for years leads to ceasefire: in pictures The remains of a building in Gaza City that was hit by Israeli airstrikes on 5 May AFP/Getty Worst violence in Gaza for years leads to ceasefire: in pictures Smoke billows from a site in Gaza targeted by Israeli airstrikes on 5 May EPA Worst violence in Gaza for years leads to ceasefire: in pictures Palestinians gather around a building hit by an Israeli air strike in Gaza on 5 May Reuters Worst violence in Gaza for years leads to ceasefire: in pictures People gather amid the rubble of a building destroyed by Israeli airstrikes in Gaza on 6 May AFP/Getty

Nine of the dead were confirmed to be militants: Israel launched its first targeted killing in Gaza since 2014, taking out Hamed al-Khodari, a man Israel said was a financier for Hamas, the armed group which runs the Strip.

In Israel, four people were killed as nearly 700 rockets and other projectiles were fired from Gaza, the first civilian Israeli deaths from Palestinian fire since 2014. Gaza militants killed one Israeli with an anti-tank missile, also a first in the last five years.

Aerial view of Israeli strike against site claimed to be Palestinian rocket manufacturer

The latest cross-border exchange of fire erupted on the eve of the holy month of Ramadan and just 10 days before thousands of foreign visitors and dozens of performers, including Madonna, were due to fly into Israel for Eurovision.

A video posted by Palestinian Islamic Jihad threatened the song contest, splicing clips of Eurovision celebrations with footage of its militants loading missiles into launchers warning that Israel “Is not Europe”.

Eurovision officials had maintained preparations were continuing as normal, but pressure piled on the Israeli authorities to come to an agreement as the days went by.

Militants began pounding Israel on Saturday morning in retaliation for the killings of four Palestinians - two protesters and two militants - by Israeli fire on Friday afternoon, after a cross border shooting incident had injured two Israeli soldiers.

The Israeli army said that Palestinian Islamic Jihad, the second largest armed group in Gaza, was behind what it called the “sniper” attack on its forces and initially had acted without the coordination of Hamas.

The US, which is due to deliver a peace plan for the region in a month, was quick to come to the support of its ally. Donald Trump assured Israel that it had Washington’s full support, shortly after a delegation of Trump-appointed US ambassadors met Mr Netanyahu in Jerusalem.

"Once again, Israel faces a barrage of deadly rocket attacks by terrorist groups Hamas and Islamic Jihad. We support Israel 100% in its defense of its citizens," Mr Trump tweeted.

"To the Gazan people - these terrorist acts against Israel will bring you nothing but more misery. END the violence and work towards peace - it can happen!"

UN Secretary-General Antonio Guterres meanwhile appealed for "maximum restraint" and condemned “in the strongest terms the launching of rockets from Gaza into Israel, particularly the targeting of civilian population centers."

Guterres's special envoy Nickolay Mladenov was "working closely with Egypt and all concerned to restore calm," the statement added.

Mr Netanyahu faced criticism back home, however. His ex-elections rival Benny Gantz, a former head of the army who led the 2014 incursion into Gaza, called the truce, after nearly 700 rockets and four Israeli deaths "a surrender to Hamas blackmail".

"All that the government has done, once again, is to put the next round of fighting ahead" of us, he added in a tweet.

Meanwhile Gideon Sa'ar, an MP for Netanyahu's own Likud Party, said that ceasefire was no achievement for Israel.