GAZA CITY, Gaza Strip — Israel expanded its fierce air assault on rocket operations in the Hamas-ruled Gaza Strip on Saturday, striking security compounds, smugglers’ tunnels and a three-story apartment building after an unprecedented rocket attack aimed at the holy city of Jerusalem raised the stakes in its confrontation with Palestinian militants.

Israeli aircraft also kept pounding their original targets, the militants’ weapons-storage facilities and underground rocket-launching sites.

The Israeli military called up thousands of reservists and massed troops, tanks and armored vehicles along the border with Gaza, signaling a ground invasion of the densely populated seaside strip could be imminent.

Israel launched its military campaign Wednesday after days of heavy rocket fire from Gaza and has carried out some 800 airstrikes since, the military said.

Militants, undaunted by the heavy damage the air attacks have inflicted, have unleashed some 500 rockets against the Jewish state, including new, longer-range weapons turned for the first time this week against Jerusalem and Israel’s Tel Aviv heartland.

Israel has slowly expanded its operation beyond military targets and before dawn on Saturday, the Gaza Interior Ministry reported, missiles smashed into two small Hamas security facilities as well as the massive Hamas police headquarters in Gaza City, setting off a huge blaze that engulfed nearby houses and civilian cars parked outside. No one was inside the buildings at the time.

The Interior Ministry said a government compound was also hit as devout Muslims streamed to the area for early morning prayers. So, too, was a Cabinet building where the Hamas prime minister received the prime minister of Egypt on Friday.

In southern Gaza, Israeli aircraft Saturday went after the hundreds of underground tunnels militants used to smuggle in weapons and other contraband from Egypt, people in the area reported.

Missiles also knocked out five electricity transformers, plunging more than 400,000 people in southern Gaza into darkness, according to the Gaza electricity-distribution company. A three-story apartment building belonging to a Hamas military commander was hit, and ambulances ferried out inhabitants wounded by the powerful explosion. Others were thought to be buried under the rubble.

Four years ago, Israel sent ground troops into Gaza one week after the start of an operation also intended to halt unremitting rocket attacks on Israeli population centers by Hamas, an Islamist movement that the United States and Israel consider a terrorist organization.

It ended two weeks later amid loud international criticism and left 13 Israelis and more than 1,000 Palestinians dead, hundreds of them civilians.

Casualties have been far lower in the current operation, suggesting that Israel is highly motivated to avoid a repeat of Cast Lead, as the 2008-2009 operation was code-named.

By Saturday morning, Gaza medical officials said at least 30 Palestinians had been killed by Israeli airstrikes. Three Israelis have been killed by the rocket fire from Gaza.

Friday began with a temporary truce between Israel and Gaza militants to accommodate a visit to the coastal strip by Egyptian Prime Minister Hesham Kandil. But the cease-fire quickly crumbled, as the Palestinians launched new waves of attacks and Gaza residents said Israel responded with renewed airstrikes. The Israeli military denied that.

The eerie wail of air-raid sirens sounded in Jerusalem after the start of the Jewish Sabbath in the holy city, claimed by both Israel and the Palestinians as a capital and about 47 miles from Gaza.

Jerusalem residents were shocked to find themselves suddenly threatened by rocket fire, which, for more than a decade, had been limited to steadily broadening sections of southern Israel.

The attack on the contested city was especially audacious, both for its symbolism and its distance from Gaza. Located about 50 miles from the Gaza border, Jerusalem had been considered beyond the range of Gaza rockets — and an unlikely target because it is home to the Al-Aqsa Mosque compound, Islam’s third-holiest shrine.

Most of the militants’ rockets do not have guided systems, limiting their accuracy, though Israeli officials believe the militants may have a small number of guided missiles that have not yet been used.

Hundreds of rockets and mortar rounds have rained down on southern Israel since Wednesday from the other side of the Gaza border, including one projectile that slammed into an apartment building in the working-class town of Kiryat Malakhi, killing two Israeli men and one woman.

Israel, which previously could count on Egyptian autocrat Hosni Mubarak’s help in isolating Hamas, is testing fragile relations with the new Islamist government in Egypt after Mubarak’s ouster in February 2011.

Egypt is now allied with Hamas and is under popular pressure to downgrade relations with the Jewish state. Hamas, after years of being shunned, feels emboldened by burgeoning ties with Egypt and other regional players, such as Qatar, and the group has called on Arab countries to form a united opposition against the Israeli occupation.

President Obama spoke separately to Israeli and Egyptian leaders Friday night as violence escalated. The White House says Israeli Prime Minister Benjamin Netanyahu called Obama on Friday to provide an update on the situation.

Netanyahu expressed appreciation to Obama and the American people for U.S. investment in the Iron Dome rocket and mortar-defense system, which has been used to defend Israel against rocket attacks from Gaza, saving many Israeli lives, the White House said.

Obama reiterated U.S. support for Israel’s right to self-defense and discussed possible ways to scale back the conflict, the White House said. It did not offer specifics.

Separately, Obama called Egyptian President Mohammed Morsi on Friday and praised Egypt’s efforts to ease tensions in the region, the White House said.