Israeli aircraft have bombed targets across the Gaza Strip and Gaza militants fired rockets into Israel as cross-border fighting enters a second day.

The latest violence was triggered by a surprise rocket fired early Monday from Gaza, a territory ruled since 2007 by the Islamic militant group Hamas.

The rocket slammed into a house in central Israel and injured seven people.

Israel Gaza
A police officer inspects the damage to a house hit by a rocket in Mishmeret, central Israel (Ariel Schalit/AP)

In response, Israeli prime minister Benjamin Netanyahu said he would cut short a visit to Washington, Israel sent troop reinforcements to the Gaza border and Hamas leaders went into hiding — signals that both sides are heading into perhaps the most serious confrontation since a 2014 Israel-Hamas war.

Late on Monday, Hamas announced a cease-fire had been brokered by Egyptian mediators, but the cross-border strikes continued into Tuesday.

Mr Netanyahu is in a tight race for re-election against former army chief Benny Gantz.

Just two weeks before the April 9 vote, he faces tough criticism from political rivals, including in his own right-wing political camp, who accuse him of being too soft on Hamas.

Hamas, meanwhile, is under growing pressure domestically because of its failure to get Israel and Egypt to ease their Gaza border blockade, imposed after the 2007 Hamas takeover.

“Israel will not tolerate this. I will not tolerate this,” Mr Netanyahu declared during a White House meeting with US president Donald Trump.

“Israel is responding forcefully to this wanton aggression,” he said. “We will do whatever we must do to defend our people and defend our state.”

Israel opened public bomb shelters in most major cities and civil defence authorities cancelled sports events and public transportation in southern Israel.

The Israeli army said several dozen rockets had been fired into Israel on Monday and Tuesday, as air raid sirens wailed across southern Israel.

The army said nearly all rockets were either intercepted or landed in open areas.

Israel Gaza
An Israeli man examines the damage to a house after it was hit by a rocket in Sderot, southern Israel (Tsafrir Abayov/AP)

Israeli airstrikes hit military sites for Hamas and the smaller Islamic Jihad group.

Gaza’s Health Ministry said seven Palestinians were injured in the airstrikes.

Monday’s attack came 10 days after rockets were fired from Gaza toward Israel’s densely populated commercial capital of Tel Aviv, and the Israeli military struck back.

Gaza’s Hamas leaders said the rocket was fired accidentally and the fighting quickly subsided.

The sounds of air raid sirens jolted residents of the Sharon area, northeast of Tel Aviv, shortly after 5am on Monday, sending them scurrying to bomb shelters.

Gaza Israel
An explosion caused by Israeli airstrikes is seen from the offices of Hamas leader Ismail Haniyeh (Adel Hana/AP)

The rocket destroyed a residential home in the farming community of Mishmeret, wounding six members of a family.

The Magen David Adom rescue service said it treated seven people, including two women who were moderately wounded. The others, including two children and an infant, had minor injuries.

The Israeli military said Hamas militants fired the rocket from southern Gaza. It said its Iron Dome rocket-defence system was not activated because the attack in central Israel had not been anticipated. The army added it was reinforcing its missile defence batteries in preparation for an escalation.

Major Mika Lifshitz, a military spokeswoman, said it was a self-manufactured rocket with a range of 75 miles, making it one of the deepest strikes ever carried out by Hamas.