Three Palestinians were killed, including a pregnant woman, a toddler and a Hamas fighter. Several Israelis were wounded, along with a 30-year-old Thai woman living in Israel.
The Hamas-run ministry of health in Gaza named two of the dead as Enas Khammash, 23, who was pregnant, and her 18-month-old daughter, Bayan. It said 12 others were injured.
The Israeli army said it had targeted “strategic military sites” including Hamas weapons manufacturing and training locations.
Late on Thursday, Palestinian officials said that Hamas and Israel had reached an agreement to end the violence. “Egyptian efforts managed to restore calm between Palestinian factions and Israel that will end the current escalation,” a Palestinian official told Reuters. “Palestinian factions will respect calm as long as Israel does.” There was no formal comment from Israel.
The bloodshed was the third severe flare-up in the past two months, during which the two sides have traded their most intense attacks since the 2014 war. There have been warnings of a possible fourth conflict in 10 years.
A long-range Grad rocket fired from Gaza on Thursday afternoon struck outside Beersheba, the largest city in southern Israel with 200,000 residents, 25 miles (40km) from the Gaza Strip.
Since late March, Palestinians have been protesting near the frontier, in part against an Israeli-imposed blockade that severely limits the movement of people and goods in and out of Gaza. The response to these mass gatherings at the perimeter fence has caused a global outcry, with snipers shooting dead more than 150 Palestinians, including children, medics and journalists. Thousands more have been wounded.
Israel says the protest movement is being orchestrated by Hamas as a cover for attacks and points to shootings along the frontier that have killed one soldier. Palestinians have in the past few weeks begun to launch “flaming kites” into Israel, torching huge swaths of farmland.
In Gaza overnight and into Thursday explosions could be seen as bombs landed. Hanan Qishawi, 32, said she and her three children were up all night in “constant terror”.
“I do not remember experiencing such a terrifying night since the end of the 2014 war. When it was quiet, I fell asleep, and suddenly a big boom woke me up. I was waiting for daylight.”
In the Israeli city of Sderot, explosions smashed up cars and motorbikes, dented pavements and pockmarked buildings with shrapnel. Sirens sounded , sending residents to bomb shelters.
Oshrit Sabag, a resident from the Israeli community of Nahal Oz, a few hundred metres from the Gaza fence, said she spent much of the night in her children’s bedroom, which doubles as the family’s bomb shelter.
“We’re mostly scared that there will be another war,” she said by phone. “We’ve had tens of fires. Houses were burnt. Now rockets and mortar bombs. It’s chaos.”
Hamas’s armed wing, the Ezzedine al-Qassam Brigades, claimed responsibility for the rocket and mortar strikes. It said Palestinian “resistance” had fired projectiles at “enemy positions in the Gaza envelope”.
The back and forth attacks began on Wednesday and continued late into Thursday.
The latest round of attacks followed the killing of two Hamas fighters on Tuesday in what the Israeli army said was an act of retaliation for a shooting attack on its forces. The militant group said the two were involved in a training exercise, not an attack, and promised to retaliate in turn.
Asked about the incident, an Israel Defence Forces spokesman, Lt Col Jonathan Conricus, said: “Hamas operatives, terrorists, were in a known Hamas position and fired weapons in a general direction towards the fence.
“I won’t go into further details on whether we understand it was an exercise or it wasn’t. But I can say that our mission is to defend Israeli civilians and of course if our soldiers are fired upon, we respond.”
Reuters and Agence France-Presse contributed to this report