AP PHOTO
Smoke rises during an explosion from an Israeli forces strike in Gaza City on Saturday.

GAZA CITY, Gaza Strip — Israel expanded its four-day assault on Gaza on Saturday, broadening its airstrikes from military targets to the civilian political infrastructure, leveling the headquarters here of the Hamas prime minister and striking police and security buildings.

Hamas continued to fire rockets at Israel, including a pair intended for the city of Tel Aviv. One landed harmlessly, probably at sea; the other was thwarted in midair by Israel.

In Cairo, the leaders of Hamas, Turkey and Qatar gathered to try to broker a truce. Hamas officials were in indirect contact with Israel through Egyptian intelligence intermediaries, an official of Egypt’s Muslim Brotherhood said.

The talks were reported to be deadlocked Saturday evening, while continued attacks in Gaza and Israel, and Israeli preparations for a possible ground invasion, suggested that neither side was ready to end the fight.

The air raid that struck the office of the Hamas prime minister, Ismael Haniyeh, came about 4 a.m., reducing the four-story building where weekly cabinet meetings were held to a huge pile of rubble.

Three Palestinian flags that used to hang over the entryway were draped across the dusty mess, with datebooks and personnel records scattered about. Haniyeh’s gray-bearded face beamed from a page of a Hamas booklet promoting “the government’s achievements despite the obstacles.”

A security official, who asked to be identified only as Abu el Abed, took one of the fallen flags and replanted it upright. “We will rebuild this place as we have rebuilt others,” he said. “Every structure that is demolished or destroyed is a big loss, but the blood of anybody wounded is more important than any structure. This place will be rebuilt and the occupation will go and we will stay.”

Mark Regev, a spokesman for Prime Minister Benjamin Netanyahu of Israel, said government buildings had been targeted because Hamas “makes no distinction between its terrorist military machine and the government structure.”

“We have seen Hamas consistently using so-called civilian facilities for the purposes of hiding their terrorist military machine, including weapons,” Regev said.

The Israeli military said that it had struck more than 200 targets overnight, including underground rocket launchers and smuggling tunnels in Rafah, on the Gaza-Egypt border. The military also said that it struck the police and homeland security headquarters of Hamas, as well as the house of a Hamas commander, Ahmed Randor.

Hamas’ military wing, the Qassam Brigades, claimed responsibility for firing an Iranian-made rocket at Tel Aviv.

Israel appeared to be keeping up the pressure on military targets as well.

Hamas said seven of its members were killed Saturday morning in two separate attacks — four in Rafah, and three in the Al-Maghazi refugee camp, in the middle of the Gaza Strip. The deadliest airstrikes today were reported in the southern town of Rafah, which borders Egypt, where six people, including four Hamas fighters, were killed in separate raids.

Israeli F16 airplanes hit a house for a commander of the Qassam Brigades in southeast Gaza City, but the house was empty at the time, Hamas officials said. The Israeli military also released video of what it said was an attack Saturday on the house of the Hamas northern brigade commander, Ahmed Randor, and said that it showed the secondary explosions that took place because of ammunition stored under the commander’s house.

The Palestinian Health Ministry in Gaza said that 40 Palestinians had been killed in the fighting so far, and more than 385 people wounded. Three Israelis have been killed.

This latest battle between Israel and Hamas, the Islamist militant group that controls Gaza, began Wednesday, when Israel launched airstrikes on Gaza in retaliation for a surge of rocket attacks in recent months from Gaza. The assault has drawn comparisons to Israel’s invasion of Gaza in late 2008, but so far Israeli ground forces have not entered Gaza.

Last week, Israel shifted infantry brigades, authorized the calling up of 75,000 reservists and blocked roads near Gaza, indicating an invasion of the coastal territory was possible.

The region’s political landscape has also shifted since the war four years ago, with Hamas gaining crucial allies in Egypt, Turkey and Qatar, as well as longer-range, apparently Iranian-made, missiles.

Israel’s Iron Dome missile defense system appears to have successfully intercepted many of the rockets from Gaza. After an attack on Tel Aviv last week, Israel deployed an Iron Dome anti-missile battery near the city, which became operational Saturday.

The missiles intercepted one of the Hamas rockets Saturday evening in the sky above the city, Israeli authorities and witnesses said.