It was one of the most serious flare-ups of fighting since the 2014 Israel-Gaza war.
Palestinian sources later said Gaza’s armed groups had agreed a ceasefire with Israel last night.
“Egyptian and international eforts succeeded in ending the current round of cross-border violence,’ an official said.
Three people were wounded in Israel when a rocket struck the southern town of Sderot, police said.
Tension had been building since Friday, when Israeli troops shot dead a Palestinian teenager during protests on the Gaza border, where weekly Palestinian protests – including attempts to breach Israel’s border fence – have drawn live fire, and an Israeli soldier was wounded.
A second Palestinian protester died of his wounds yesterday.
Israeli Prime Minister Benjamin Netanyahu said: “We will expand the scope of our reaction to (Islamist movement) Hamas’ terror attacks as much as needed. If Hamas doesn’t get our message today, it will tomorrow.”
Sporadic Palestinian rocket attacks and incendiary kites from Gaza that have burned large tracts of farmland in Israeli border areas have increased public pressure on Netanyahu for a stronger armed response.
The Israeli military said it had struck more than 40 targets within several militant compounds belonging to Hamas, in what it described as one of its widest operations since the 2014 conflict.
The blasts shook homes and shattered windows, and black plumes of smoke rose from the sites of the explosions.
The Israeli military said one air strike had hit a high-rise building in Al Shati refugee camp in the northern Gaza Strip, describing the target as a Hamas urban warfare training facility with a tunnel underneath.
Health officials in Gaza said the building was empty, but two Palestinians aged 15 and 16, among a crowd in a nearby public park, were killed. Around 10 other passers-by were wounded, the officials said. Nearby houses were damaged.
During the day’s fighting, Gaza militants fired more than 90 mortar bombs and rockets toward Israel, the military said, setting off sirens and sending Israelis fleeing to shelters. Some were intercepted by Israel’s Iron Dome missiles.
Rocket warning sirens went off in the coastal city of Ashkelon, about 12km from the enclave, further north than in recent rocket attacks. A police spokesman said no hits had been identified in the city.
A Palestinian official said Egypt and other international players were holding contacts with Israel and Gaza to restore calm. There was no immediate comment from officials in Cairo.
The fighting began on Friday, when thousands of Palestinians gathered at the Israel-Gaza border area for weekly protests that have now entered their fourth month.
The Israeli military said Friday’s protesters were throwing burning tyres, stones, explosive devices and fire bombs at its soldiers and that one of its officers was wounded by a Palestinian grenade hurled across the border fence.
Hours later, the military launched a series of air strikes in Gaza.
Israel says Hamas has been orchestrating the weekly protests to distract from governance problems and provide cover for militants’ cross-border attacks. Hamas denies this. Its spokesman Fawzi Barhoum yesterday blamed Israel for the escalation.
More than 130 Palestinians have been killed by Israeli forces in the protests.
There have been no Israeli fatalities during the so-called “Great March of Return” demonstrations.
Gaza is home to two million Palestinians. Poverty has become widespread and vital infrastructure has collapsed under a 12-year blockade by Israel, which says its aim is to curb security threats by Hamas.