JERUSALEM — Israeli jets bombed a string of targets in Gaza into the night Monday following a rocket attack near Tel Aviv, as Palestinian militants fired back, edging the country toward all-out conflict just two weeks before elections and forcing Prime Minister Benjamin Netanyahu to cut short his trip to Washington.

The rocket, which the Israeli military said was manufactured and fired by Hamas, slammed into a family house near Tel Aviv, injuring seven Israelis just hours before Netanyahu was due to meet with President Trump. 

In comments from the White House, the Israeli leader announced that Israel’s response was already underway as the military said it was calling up reservists and sending additional tanks and troops to the area. “Israel will not tolerate this. I will not tolerate this,” Netanyahu said, speaking next to Trump in the diplomatic reception room. “Israel is responding forcefully to this wanton aggression.” 

The airstrikes lit the Gaza skyline with orange fireballs, as civilians in both Gaza and communities in Israel braced for a night of violence. Israel’s military said it struck three targets: the home of Hamas leader Ismail Haniyeh, a building that served as a secret headquarters for Hamas military intelligence and a five-story internal security office in the Rimal neighborhood of Gaza City. Palestinian heath authorities in Gaza did not report fatalities but said seven people were injured.

Shortly after sirens sounded in border communities, residents scrambled into safe rooms, with rockets firing late into the night. The Israeli military said at least 30 rockets were fired from Gaza by 10 p.m. One hit a house in Sderot. Earlier, Haniyeh warned that the “resistance” would respond if Israel’s retaliation crossed “red lines.”

Armed factions in Gaza said they had targeted Sderot and Netivot, saying that if Israel increased its response, “we will do the same.”

The escalation comes just two weeks before Israel’s April 9 elections, presenting Netanyahu with a delicate situation. He will need to mount a response strong enough to satisfy rattled border communities and right-wing coalition partners while not risking a full-blown conflict that could spiral out of control and harm his reelection chances.

Hamas announced that an Egyptian-brokered cease-fire was set for 10 p.m. local time. Israeli officials declined to comment, but airstrikes and rocket fire continued after the deadline passed.

Israeli commentators said that if the prime minister agreed to a cease-fire, it would probably hurt his campaign. 

“If Netanyahu is now going to a ceasefire, it is recommended that at least the slogan of the campaign be changed from ‘Right. Strong’ to something else,” tweeted Moran Azoulay, political reporter for Israeli daily Yediot Aharonot. 

Reuven Hazan, a professor of political science at the Hebrew University of Jerusalem, said an escalation of violence could also hurt Netanyahu politically.

“Unlike in previous elections, this is the first time Netanyahu is facing a party that is led by people who are more prominent than him on security issues,” he said. 

His main election rival, former Israeli military chief of staff Benny Gantz, addressed the American Israel Public Affairs Committee (AIPAC) on Monday in his first high-profile English-language address, stressing his security credentials. 

“If we want hope, we must have unity; if we want security, we must have unity; throughout history, the only way we have won is by being united! Unity is our past, and unity must be our future!” he told a welcoming crowd. “I will return to Israel — to stand and if needed to fight in defense of my people, our people. I am a soldier. That is who I am. That is what I do.”

Two other top leaders of Gantz’s Blue and White party, which is leading over Netanyahu’s Likud in some polls, are former military chiefs of staff. 

Netanyahu, who is fighting corruption allegations, has been criticized by some for being too soft on Hamas before; his defense minister, Avigdor Liberman, resigned last year after Israel agreed to a cease-fire with Hamas after the worst bout of rocket fire from Gaza since the 2014 war between the two sides. 

An official close to the prime minister’s office, who spoke on the condition of anonymity, said Netanyahu had been apprised by security officials “night and day” while he was in Washington and approved a list of targets presented by the Israeli military.

“We will have a very powerful response,” Netanyahu said as he departed for Israel on Monday evening. “Hamas should know that we should not hesitate to do everything possible, not dependant on time or date, to ensure the security of Israel.”

Netanyahu missed an address to AIPAC’s annual policy conference in Washington and a state dinner with Trump, both scheduled for Tuesday. 

The violence overshadowed Trump’s signing of an official proclamation recognizing Israeli sovereignty of the Golan Heights, considered by much of the international community to be illegally occupied by Israel since the 1967 war.

Hamas has been under pressure in recent weeks from internal protests of dire living conditions in Gaza, which it has dispersed with force, including live ammunition. A year after border demonstrations intended to “break the siege” imposed by Israel and draw attention to the right of return, some residents complain that they have little to show for it other than 250 deaths by sniper fire. 

Analysts had speculated that Hamas would attempt to ramp up pressure on Israel to extract more concessions in negotiations brokered by Egypt. A deal to allow in Qatari cash to pay salaries and fuel Gaza’s power station expires in weeks.

The Israeli military said the rocket that hit the house in central Israel had a range of 75 miles. Kobi Michael, a senior researcher at Israel’s Institute for National Security Studies, said Monday’s rocket was an improved version of an M75, a locally made projectile similar to Iran’s Fajr rocket.

“Hamas has improved its range, its engine and the capacity to carry more fuel,” he said, adding that rockets had managed to penetrate further into Israel in the past.

Pictures of the scene of the first house hit Monday morning showed a bed and a crib strewn with rubble and the dwelling’s roof caved in. Assi Dvilanski, a paramedic called to the scene, said it was “a miracle that no one was killed.” He said he had treated family members with burn injuries from the blast. 

Robert Wolf, who lived there with his family, told reporters that if he and his wife, son, daughter-in-law, daughter and two young grandchildren had not gotten to the bomb shelter inside, they would have surely been killed in the blast. 

“This is the real price, and I just paid it,” he said. “I nearly lost my family. If we hadn’t got to bomb shelter in time then I would be burying my entire family.”

Morris reported from Washington.