JERUSALEM — Prime Minister Benjamin Netanyahu of Israel cut short his visit to the United States on Monday, hours after a rocket launched from Gaza struck a house in central Israel, injuring seven people and posing a new challenge to his bid for re-election just two weeks before Israelis go to the polls.
The Israeli military said that Hamas, the militant group that controls Gaza, had fired the long-range rocket, and later issued a statement that it was “striking Hamas targets throughout the Gaza Strip.”
Appearing at the White House with President Trump before returning to Israel, Mr. Netanyahu said, “As we speak, Israel is responding forcefully to this wanton aggression.”
The Israeli military said it was deploying an additional infantry brigade and an armored brigade to bolster its forces around the territory, and was calling up a limited number of reservists from specialized units, apparently preparing for a possible escalation in the long-simmering cross-border conflict.
The rocket strike presents a test for Mr. Netanyahu, a conservative who also serves as Israel’s defense minister. Both Hamas and Israel have been avoiding another all-out conflict since 50 days of fighting ended in the summer of 2014, but Mr. Netanyahu’s political rivals have been denouncing a lack of decisive action or clear policy regarding Gaza, despite several bouts of rocket fire.
A strong response could protect Mr. Netanyahu politically while helping restore his reputation as a national security hawk. But starting a bloody conflict that could put Israelis under heavy rocket fire and result in Israeli casualties with an election looming would seem to be problematic.
Already facing indictment for bribery and other corruption charges, Mr. Netanyahu, who has long presented himself as Israel’s security czar, is in a tight race with his chief rival, Benny Gantz, a retired military chief of staff.
“In light of the security events, I decided to cut short my visit to the U.S.,” Mr. Netanyahu said on Monday, soon after landing in the United States, adding that he would fly back immediately after meeting President Trump.
Mr. Netanyahu called the strike, in which two children were injured, a “criminal attack,” adding, “we will respond forcefully.”
At the United Nations, Stéphane Dujarric, a spokesman for Secretary General António Guterres, called the rocket strike on Israel “a serious and unacceptable violation,” and urged all sides to “exercise maximum restraint” in the long-simmering conflict.
“A further escalation is likely to make a bad situation worse,” Mr. Dujarric said.
After their White House meeting, Mr. Trump signed a proclamation recognizing Israeli sovereignty over the Golan Heights, seized from Syria in 1967 — a break with five decades of American policy — and denounced the rocket attack.
“The United States recognizes Israel’s absolute right to defend itself,” the president said.
While in Washington this week, Mr. Netanyahu had been expected to address a policy conference organized by the American Israel Public Affairs Committee, known as Aipac, on Tuesday. His appearance at the conference has now been canceled. Mr. Gantz was in Washington and addressed the conference Monday.
The rocket fire also abruptly changed the agenda in Gaza, where Hamas has come under harsh criticism for its recent violent crackdown on protesters demonstrating against harsh living conditions in the Palestinian coastal territory.
Yehya Sinwar, the leader of Hamas in Gaza, canceled a speech he was scheduled to deliver on Monday afternoon.
The rocket struck a house at 5:20 a.m. in the village of Mishmeret, about 20 miles north of Tel Aviv and just southeast of the Mediterranean coastal resort of Netanya.
Magen David Adom, an Israeli rescue service, said it had treated seven people for burns, blast injuries and shrapnel wounds, as well as several others suffering stress symptoms. The wounded included a man and a woman in their 60s, two children, and an infant, the service reported. Eli Bin, the director of Magen David Adom, said at the scene that the event had ended “miraculously with only light to moderate injuries.”
There was no immediate claim of responsibility in the attack, nor any immediate denial from Hamas.
Maj. Mika Lifshitz, a spokeswoman for the Israeli military, said the rocket had been manufactured by Hamas, had a range of about 75 miles and was fired from Rafah at the southern end of the Gaza Strip, meaning it probably went as far as it could have gone.
Though incoming rocket sirens sounded in Mishmeret, sending residents rushing to bomb shelters shortly before the rocket struck, it was not intercepted by Israel’s Iron Dome air defense system.
“Iron Dome protects the areas in which it is deployed,” Major Lifshitz said, refusing to elaborate, but suggesting that the system did not cover Mishmeret.
Television images showed the one-story house that was hit as having been almost destroyed. The rocket crashed through the roof. The blast shattered the windows of nearby houses and caused a large swath of damage. Paramedics who arrived on the scene said that six members of the family living in the house had managed to get out. They said the family had been on their way to their safe room when they heard the explosion and part of the building collapsed.
One resident, Varda Chen, held up a torn and bloody shoe on television, saying it belonged to her granddaughter, 12, who had been injured by shrapnel.
The rocket attack comes less than two weeks after Israel and Hamas worked to de-escalate tensions after two rockets from Gaza were fired at Tel Aviv. One struck open ground near the suburb of Holon. The other may have exploded in midair or fallen into the sea. Neither were intercepted by the Iron Dome system.
At the time, Hamas and Islamic Jihad, a more militant group in Gaza that also possesses long-range rockets, distanced themselves from the rocket fire, and the Israeli military accepted an explanation that the two rockets had been launched “by mistake,” possibly because of a technical error.
After a rocket from Gaza hit a house in the southern Israeli city of Beersheba in October, there was speculation on both sides that it may have been set off by lightning in a storm. That suspicion was never confirmed, though a military official said it was technically possible.
Hamas officials could not immediately be reached after Monday’s attack. Islamic Jihad issued a statement warning Israel “against any aggression against the Gaza Strip.”
Eran Lerman, a former deputy director of Israel’s National Security Council and now vice president of the Jerusalem Institute for Strategy and Security, a research group, said the latest rocket attack was “no longer something that can be explained away as a mistake or a technical failure.”
He told reporters that the militant groups in Gaza may have come to “the very dangerous conclusion that Israel’s hands may be tied because of the impending elections on April 9 and that the prime minister and his government would be very wary about taking action so close to an election which could lead to a broad-scale confrontation.” Hamas, he warned, was “playing with fire.”
Mr. Netanyahu came under immediate attack from political rivals from the right, left and center.
“The reality in which Hamas turned Israel into a hostage is unprecedented and unfathomable,” Mr. Gantz, of the centrist Blue and White coalition, wrote on Twitter. “Netanyahu has to pack up now and return to Israel to handle this serious escalation.”
The New Right party, led by the ministers Naftali Bennett and Ayelet Shaked, said in a statement, “Israel’s deterrence has collapsed and it has to be said in all honesty, Netanyahu has failed against Hamas.”
The leader of the Israeli Labor Party, Avi Gabbay, and his No. 2, Tal Rousso, a retired general, went to Mishmeret, where Mr. Gabbay denounced Mr. Netanyahu as a “failed prime minister and defense minister” and a man of “talk and not actions.”
After several recent bouts of rocket fire, the military has responded with airstrikes against militant targets in Gaza but has struck facilities already evacuated by Hamas ahead of time, avoiding casualties. Some of Mr. Netanyahu’s rivals have been pushing for more aggressive action, including a return to targeted killings of militant leaders.
On Sunday, the Israel Defense Forces said explosives had been “hurled” during riots in Gaza, near the Israeli border, and that Israel had struck two Hamas posts in response.