JERUSALEM — Two rockets were fired at Tel Aviv from the Gaza Strip on Thursday, the Israeli military said, the first time since 2014 that rockets had reached the area.
Israel’s Iron Dome missile-defense system detected the incoming rockets around 9 p.m. and sounded alarms, which were heard across metropolitan Tel Aviv on a rainy night. No injuries or damage were reported, but residents reported hearing loud blasts and the mayor ordered bomb shelters opened.
The two militant Islamic factions with the capability of hitting Tel Aviv from Gaza, Hamas and Palestinian Islamic Jihad, both quickly denied responsibility for the attack and said they had no intention of escalating violence with Israel.
Early Friday, the Israeli military said that it had “just started striking terror sites in Gaza” in response, but offered no details. Minutes later, the military reported that air-raid sirens had sounded in an Israeli community near the border with Gaza.
The Palestinian newspaper Al Quds described the airstrikes by the Israeli military as a “series of raids” across the Gaza Strip, and detailed multiple strikes on northwestern Gaza City.
In the attack against Tel Aviv on Thursday, the Israeli military initially reported that one rocket had been intercepted and the other had landed in an open area, but it later withdrew the statement. Its corrected statement said there had been no interceptions, gave no information on whether interceptor missiles were fired, and did not say what happened to either incoming rocket.
Prime Minister Benjamin Netanyahu rushed to the military’s headquarters in Tel Aviv to be briefed on the attack.
Mr. Netanyahu has sought to avoid war with Gaza and has tended to respond to scattered rocket attacks over the past year with relative restraint. With notable exceptions, Israel has often answered with airstrikes that pounded Hamas military emplacements evacuated of their personnel, doing damage to buildings but not shedding much blood.
Now, however, he is campaigning for re-election on April 9, facing pressure from hawkish right-wing rivals — like Naftali Bennett, the education minister who wants to be defense minister — and a serious challenge from a new party, Blue and White, led by three former army chiefs.
Mr. Bennett, of the New Right party, demanded a plan to “defeat Hamas once and for all.”
“Not more shooting at sand dunes without causing harm to the enemy,” he said, “but time for an uncompromising pursuit and systematic neutralization of Hamas’s leaders.”
The justice minister, Ayelet Shaked, also of the New Right party, added her two cents on Twitter: “Two words — Bennett defense.”
And the leading challenger to Mr. Netanyahu, Benny Gantz of the Blue and White party, who as the army chief led the 2014 Gaza war, urged “a significant and sharp response, otherwise it will be impossible to renew deterrence.”
Hamas, which controls the coastal enclave, said Thursday that it would seek to punish those responsible for the Tel Aviv attack, suggesting that someone in one of the militant groups could have been acting in defiance of orders.
In a statement, its military wing said, “We are not responsible for the rockets fired at the enemy tonight.”
Hamas has been in negotiations with Israel, through Egyptian intermediaries, for months, and it said that the rocket attack had occurred while its representatives were meeting with Egypt’s emissaries.
Palestinian Islamic Jihad, a more militant rival, is said to be impatient with the pace of those talks, and has at times used attacks on Israel to make itself heard. But a spokesman for Palestinian Islamic Jihad, Daoud Shehab, denied it had any role in the attack. “The factions have no intention to escalate,” he said.
Israeli analysts suggested one possible reason that Hamas would have allowed the attack, or even carried it out. Protests against conditions in Gaza were held in several parts of the territory on Thursday in defiance of Hamas officials, and local security forces were videotaped beating some demonstrators with clubs, leading to speculation that Hamas might welcome an exchange of fire with Israel to divert attention from the protests.
Jason Greenblatt, President Trump’s special envoy to the Middle East, did not hesitate to conclude that Hamas was responsible.
“Hamas violently suppresses its own people demonstrating against Hamas’ rule & failures today and NOW fires rockets at cities in Israel,” he wrote on Twitter. “OUTRAGEOUS! This is what prevents the world from helping the people of Gaza! We strongly support Israel in defense of its citizens. Always!”
Hamas and Palestinian Islamic Jihad have generally been quick to take responsibility for rocket strikes on Israel.
But in another surprise attack, in October, a rocket from Gaza made a direct hit on a house in the southern city of Beersheba, crashing through the roof and destroying the bedrooms where three children had been sleeping moments earlier. Their mother saved them by rushing them down to a bomb shelter as the siren sounded, with seconds to spare, likely averting a wider war.
The same night, a second rocket fell into the sea after it was fired toward the crowded coastal area of central Israel.
That time, too, both Hamas and Islamic Jihad denied involvement, though the military said they were the only groups in Gaza with the midrange rockets that were used. There was speculation on both sides that the rockets may have been set off by lightning in a storm, though that suspicion was never confirmed.
Iron Dome apparently failed to identify the rocket that hit Beersheba in October. The military responded with airstrikes against about 20 targets in Gaza.
Yaakov Amidror, a former Israeli national security adviser and retired general, raised the possibility that Iran, which is an important backer of both Hamas and Palestinian Islamic Jihad, could have been behind the Thursday attack.
Separately, Iran hacked into Mr. Gantz’s private cellphone some time ago, his campaign confirmed Thursday night after the security lapse was reported by Israeli television. A spokesman suggested the hacking was being reported only now to embarrass Mr. Gantz in the heat of the political campaign.
Neither Israel nor Hamas had any desire for a new war, Mr. Amidror said, but the delicate standoff between Israel and Gaza meant that the potential counterstrikes ran the risk of getting out of hand.
“Now it’s very much in the hands of the reaction of the I.D.F.,” he said, referring to the military, “and their reaction to the reaction.”