In response, the Israeli military conducted an airstrike against a group of Palestinians it said was launching incendiary balloons toward Israel from the southern Gaza Strip, east of the city of Rafah.
Rockets were fired at southern Israel from Gaza, the Israeli military said, without causing any casualties.
A 15-year-old Palestinian who tried to climb over the fence into Israel was shot dead.
Israeli Prime Minister Benjamin Netanyahu said: "We will expand the scope of our reaction to Hamas' terror attacks as much as needed".
Striking in the heart of Gaza City is typically only seen during full-blown conflicts like the war of 2014 and could mark a sign that violence is escalating. "They were crowned by the success of the Egyptian effort to restore calm and end the escalation".
Israel and armed groups in Gaza have reached a ceasefire after a surge in cross-border violence, according to a Palestinian official.
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. One rocket landed inside a kibbutz in the Shar HaNegev Regional Council area.
One rocket hit a home in the town of Sderot. Most of the recent rockets from Gaza have been fired by smaller factions but Hamas spokesman Fawzi Barhoum said it was an "immediate response" that was meant to "deliver the message".
It was the largest daytime attack by Israel on the coastal enclave controlled by the Hamas Islamist group since the 2014 Israel-Gaza war, an army spokesman said.
"We are talking about the biggest offensive strikes since Protective Edge", Air Force Brigadier General Tzvika Haimovic told journalists, referring to Israel's name for its 2014 operation in the Gaza Strip.
Federer stunned in 5-set upset | Professional
Anderson became the first South African in the Wimbledon semifinals since Kevin Curren in 1983 and just the sixth in history. Eight-time champion Roger Federer has been taken to a fifth set by Kevin Anderson in the Wimbledon quarterfinals.
They will abide by the cease-fire as long as Israel does, Shiha said.
"The action we are taking draws a clear red line: that from now on, we will not allow this", he said.
The blasts shook homes and shattered windows, and black plumes of smoke rose from the sites of the explosions.
The Israeli Air Force has struck dozens of targets in the Strip in retaliation. The Israeli military aggression killed almost 2,200 Palestinians and injured over 11,100 others. Nearby houses were damaged.
Hamas was quick in retaliatory attacks against Israeli positions in the occupied Palestinian territories when it launched 90 rockets.
Israel said it was focused on hitting militant targets and was warning Gaza civilians to keep their distance from certain sites.
Israel Defence Forces said almost 100 rockets and mortar shells were fired in less than 24 hours, setting off warning sirens in border communities. "Bombardment for bombardment", he said.
On Friday, thousands of Palestinians gathered near the Gaza border for their near-weekly protest.
Hours later, the military launched a series of airstrikes in Gaza.
Israel and Egypt said the blockade was a necessary security measure against militants.