JERUSALEM (AP) -- The Gaza border region was quiet but tense on Tuesday morning after a night of heavy fire as Israeli aircraft bombed targets across the Gaza Strip and Gaza militants fired rockets into Israel in what threatened to escalate into a major conflict, just two weeks before the Israeli election.
Schools in southern Israel were cancelled for the day and the military massed forces on the Gaza border and imposed restrictions on civilian public gatherings, after dozens of rockets were fired toward communities in the area, including one that struck a house in the town of Sderot.
The Israeli air force pounded militant sites of Gaza's Hamas rulers and the smaller Islamic Jihad group. The targets included a multistory building in Gaza City that Israel said had served as a Hamas military intelligence headquarters and the office of Hamas leader Ismail Haniyeh. Gaza's Health Ministry said seven Palestinians were wounded in the airstrikes.
Prime Minister Benjamin Netanyahu was to return from Washington later in the day and head directly to military headquarters in Tel Aviv for consultations on the next steps. He faces the difficult task of delivering a tough blow to Hamas while avoiding protracted fighting that could work against him on election day.
Netanyahu has come under heavy criticism from both allies and opponents for what they say has been an ineffective policy of containing Gaza militants. He has conducted indirect cease-fire talks through Egyptian mediators in recent months, and even allowed the delivery of millions of dollars of Qatari aid to Hamas to ease harsh conditions in Gaza.
After a meeting with President Donald Trump and before leaving Washington, Netanyahu indicated the election would not deter him from acting.
"We have responded very, very forcefully. Hamas needs to know that we will not hesitate to go in and take all necessary steps — regardless of anything, any date, other than Israel's security needs," he said.
The cross-border fighting was triggered by a surprise rocket fired early Monday from Gaza that slammed into a house in central Israel and wounded seven people.
The Israeli military said it was a self-manufactured rocket with a range of 120 kilometers (75 miles), making it one of the deepest strikes ever carried out by Hamas. The military mobilized two armor and infantry brigades and drafted some reserve forces before striking back at militant sites in Gaza.
Gaza's Hamas rulers announced later in the day that Egyptian mediators had brokered a cease-fire but the firing continued overnight before calm appeared to return early Tuesday.
The rocket attack prompted Netanyahu to cut short a visit to Washington and return home, setting the stage for perhaps the most serious conflict since a war in 2014. But with no fatalities reported on either side yet, and the quiet holding for the moment, it still seemed possible to step back from the brink once again.
Two weeks ago, 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.
Israel and Hamas have fought three wars in the last decade. Although neither side appears to have an interest in another war, fighting could easily spin out of control. The 2014 conflict lasted 50 days and ended with over 2,000 Palestinian deaths, including hundreds of civilians, and 73 killed on the Israeli side.
In Gaza, Hamas is facing perhaps its toughest domestic test since seizing control of the coastal territory from the rival Palestinian Authority 12 years ago.
An Israel-Egyptian blockade, imposed to weaken Hamas, combined with sanctions by the Palestinian Authority and mismanagement by the Hamas government, have all fueled an economic crisis that has left Gaza with an unemployment rate above 50 percent.
Hamas has been leading weekly protests along the Israeli border for the past year in hopes of easing the blockade, but the demonstrations, in which some 190 people have been killed by Israeli fire, have done little to improve conditions.
Last week, hundreds of Gazans protested the dire conditions, a rare expression of public discontent against the authoritarian government. Hamas responded with a violent crackdown, beating and arresting dozens of demonstrators and drawing rare public criticism.
By limiting its fire to border communities after Monday's long-range launch, Hamas seems to be trying to keep the conflagration on low intensity. For Israelis living along the border who have suffered from years of rocket attacks that is little comfort.
"The Israeli government can't, under no circumstances, settle," said Haim Jellin, a Labor party candidate for parliament and a former head of the bordering Eshkol regional council. "Firing at Israeli communities that border with Gaza is the same as firing toward Tel Aviv, and it's impossible we will show restraint at the continuous firing."