Israel and the Islamist group that rules the Gaza Strip made dueling victory claims Wednesday night after an Egyptian-brokered cease-fire ended a blistering week-long crackdown on militants in the Palestinian enclave.

The deal averted a ground war that Israel had threatened, but it leaves the crux of the conflict unresolved, with neither side winning major concessions. The agreement restricts Israel from deploying ground troops or targeting militant leaders in Gaza, while Palestinian factions there are commanded to cease rocket attacks on Israel.

Although some details remained to be worked out, the terms addressed the most combustible elements in a dangerous cycle that had quickly escalated into the most serious clash since 2009 between Israel and Hamas, the militant Islamist group in Gaza.

After seven days in which hundreds of Palestinian rockets were fired into southern Israel and hundreds of Israeli airstrikes targeted Gaza, the United States and Egypt played key mediating roles in the accord, which was announced in Cairo after a meeting between Secretary of State Hillary Rodham Clinton and Mohamed Morsi, the Egyptian president.

The agreement came despite a fierce overnight barrage of airstrikes by Israel in Gaza and a midday bombing attack on a public bus in Tel Aviv that left 22 Israelis wounded and carried the potential to contribute to a worsening spiral.

The rubble-covered streets of densely populated Gaza thundered with the pops of celebratory gunfire as the truce went into effect at 9 p.m. local time, while the Israeli military pointed to its success in killing seven senior militants with air attacks as evidence of a battle triumph.

But both sides said they stood poised to resume fighting if the deal broke down, and it was clear that the truce had the potential to unravel. Several rockets were fired from Gaza into Israel after the cease-fire went into effect, Israeli media reported.

The tone of the victory claims by both sides showed the unrelenting hostility that remains between the foes. And the fighting had the potential to escalate into a broader regional war at a time when upheaval across the Middle East has added to a sense of instability.

“Their aim was to deter us,” senior Hamas leader Khaled Meshal said of Israel on Wednesday night. “The resistance showed them. This deterrence has failed. Israel has failed in all of its goals, thanks to God.”

For its part, the Israeli military issued a statement saying the campaign, dubbed Pillar of Defense, had “accomplished its pre-determined objectives” by degrading Hamas’s command-and-control apparatus, devastating its infrastructure and destroying the network of tunnels used to smuggle weapons.

The military said Israeli airstrikes had “severely impaired’’ Hamas’s ability to launch rockets into Israel from the Gaza Strip. In addition, it said the country’s new, U.S.-funded missile defense system, called Iron Dome, had intercepted 84 percent of 421 Palestinian rockets that would have otherwise landed in populated areas of Israel.

Having dashed to the region in pursuit of a deal, Clinton flew home to the United States on Wednesday night after a journey that had taken her from Cambodia to Israel and then to the West Bank and Cairo. And with his intervention, Morsi reasserted Egypt’s traditional role as a pivot between Israel and its foes by brokering the deal and becoming its guarantor.

Gaza rocket attacks, Israeli airstrikes double from 2008 conflict

The midday attack in Tel Aviv was the first such bombing in the coastal city since April 2006, and it prompted police to cordon off the area around the wrecked bus out of concern that other explosions could follow.

A scene of wreckage surrounding the blue-and-white bus left residents looking dazed and horrified, and some Israelis said the attack made clear the threat that Hamas and other Palestinian militants still pose.

“We now have to fight,” said Dalia Kaminer, 70, an English teacher. “This is what I feel. Now there is no way back.”

Among those still warning at day’s end that the truce could be shattered were Mark Regev, a spokesman for Israeli Prime Minister Benjamin Netanyahu, who said Israel had not completely discarded the option of a ground invasion.

“The level of confidence Israel has in Hamas is zero,” Regev said Wednesday night. “The fact that you have a regional power like Egypt and a global power like the U.S. acting as sponsors and guarantors of these understandings has given us confidence.”

If Hamas violates the terms, he cautioned, “we reserve the right to respond robustly to defend our people.”

Hamas officials said Wednesday that they would hold to their pledges. But they, too, said they were ready to return to fighting.

“Hamas was only defending itself and its people,” said Mousa Abu Marzook, the deputy leader of Hamas. But he also said that if other groups in Gaza fire rockets in the coming days, Hamas should not be “punished” for those mistakes.

Said Meshal, the senior Hamas leader: “If Israel commits, then we commit. If they do not commit, our hands are on the trigger.”

The crisis had escalated as President Obama was on a trip to Asia. In Washington, administration officials who offered an account of the White House role said Obama had spoken almost daily with Netanyahu and several times with Morsi, whose rise to power had been viewed warily by the White House because of his close links to the Muslim Brotherhood.

“Morsi has been incredibly constructive and fundamentally pragmatic,” an administration official said, speaking on the condition of anonymity to describe private discussions. Morsi took a bold position by agreeing to negotiate with Israel, the official said, noting that he “took a key role and did something that was not easy for him politically.”

As part of the negotiations, the United States pledged to continue supporting the Israeli military financially.

“The people of this region deserve the chance to live free from fear and violence,” Clinton said in Cairo after Egypt’s foreign minister announced the truce. “In the days ahead, the United States will work with partners across the region to consolidate this progress.”

A senior Israeli defense official, speaking before news of the truce had been announced, said the armed forces had been ready to roll out a “massive” ground operation whose footprint would have eclipsed the three-week war that Israel fought in Gaza in the winter of 2008 and 2009.

In the current operation, the defense official said, Israel initially aimed at targets least likely to result in civilian casualties, included armed drones and caches of long-range rockets that Israel says Hamas had amassed with help from Iran. The official, who spoke on the condition of anonymity, said the strikes were later expanded to include a broader spectrum of targets, resulting in dozens of civilian casualties. A military official said Israel’s preliminary assessment concluded that the more than 160 Palestinians killed in the attacks included at least 46 civilians.

The Israeli official said the military believes Gaza militants still possess several hundred to a few thousand rockets that were not destroyed during the campaign. The munitions were smuggled through tunnels over the past four years with help from Bedouin tribesmen in Egypt’s Sinai region.

The only long-term solution to the conflict, the official said, is finding a way to steer Hamas away from militancy and boost its sovereignty. Absent that, he said, a decisive military victory would take a massive undertaking.

“If you want to really finish their capabilities, there’s only one real solution for that — occupy Gaza for a long time, enter house after house, as we did in the West Bank,” he said. “This is not the current policy of Israel, but things can change.”

Birnbaum reported from Cairo. Karen DeYoung in Washington, Karin Brulliard in Jerusalem, Abigail Hauslohner in Gaza City and Ingy Hassieb in Cairo contributed to this report.