CAIRO/GAZA (Reuters) - Israel and the Islamist Hamas movement agreed on Wednesday to an Egyptian-sponsored ceasefire to halt an eight-day conflict around the Gaza Strip that has killed more than 140 Palestinians and five Israelis.
Announcing the ceasefire in Cairo, Egyptian Foreign Minister Mohamed Kamel Amr said it would come into force at 9 p.m. (15:00 EDT) - which would give 1.7 million Palestinians respite from days of ferocious air strikes and halt rocket attacks from Gaza that for the first time reached Tel Aviv and Jerusalem.
A flurry of explosions shook the city of Gaza as the truce deadline approached and several rockets landed in the southern Israeli city of Beersheba.
Amr said mediation efforts had "resulted in understandings to cease fire, restore calm and halt the bloodshed".
U.S. Secretary of State Hillary Clinton, standing alongside him, thanked Egypt's new Islamist President Mohamed Mursi for his peace efforts, saying his government was assuming "responsibility, leadership" in the region.
Israeli Prime Minister Benjamin Netanyahu told U.S. President Barack Obama he was ready to give the ceasefire a chance, but that "more forceful action" might be needed if it failed, according to a statement from his office.
Obama in turn reiterated his country's commitment to Israel's security and pledged to seek funds for a joint missile defense program, the White House said.
Senior Hamas lawmaker Ahmed Bahar said Israel had "submitted to the conditions and demands set by the resistance" and he hailed the outcome as a triumph.
"Resistance achieved a historical victory against the occupation and laid the foundation for the battle of liberation of the full land and sacred sites," Bahar, deputy speaker of the Palestinian parliament, said in a statement from his office.
According to a text of the agreement seen by Reuters, both sides should halt all hostilities, with Israel desisting from incursions and targeting of individuals, while all Palestinian factions should cease rocket fire and cross-border attacks.
The deal also provides for easing Israeli restrictions on Gaza's residents, who live in what British Prime Minister David Cameron has called an "open prison".
The text said procedures for implementing this would be "dealt with after 24 hours from the start of the ceasefire".
Israeli sources said Israel would not lift a blockade of the enclave it enforced after Hamas, which rejects the Jewish state's right to exist, won a Palestinian election in 2006.
The ceasefire was forged despite a bus bomb explosion that wounded 15 Israelis in Tel Aviv earlier in the day and despite more Israeli air strikes that killed 10 Gazans.
The Tel Aviv blast, near the Israeli Defence Ministry, touched off celebratory gunfire from militants in Gaza and had threatened to complicate truce efforts. It was the first serious bombing in Israel's commercial capital since 2006.
In Gaza, Israel struck more than 100 targets, including a cluster of Hamas government buildings. Medical officials said a two-year-old boy was among the dead.
Israel has carried out more than 1,500 strikes since the offensive began with the killing of a top Hamas commander and with the declared aim of deterring Hamas from launching rocket attacks that have long disrupted life in southern Israeli towns.
Medical officials in Gaza said 146 Palestinians, more than half of them civilians, including 36 children, have been killed in Israel's offensive. Nearly 1,400 rockets have been fired into Israel, killing four civilians and a soldier, the military said.
Egypt, a longstanding U.S. ally now under Islamist leadership after last year's overthrow of Hosni Mubarak, took center stage in diplomatic efforts to halt the carnage, using its privileged ability to speak directly to both sides.
"This is a critical moment for the region," Clinton said. "Egypt's new government is assuming the responsibility and leadership that has long made this country a cornerstone for regional stability and peace."
She also pledged to work with partners in the region "to consolidate this progress, improve conditions for the people of Gaza, provide security for the people of Israel".
Egypt has walked a fine line between its sympathies for Hamas, an offshoot of the Muslim Brotherhood to which Mursi belongs, and its need to preserve its 1979 peace treaty with Israel and its ties with Washington, its main aid donor.
"Egypt calls on all to monitor the implementation of what has been agreed under Egypt's sponsorship and to guarantee the commitment of all the parties to what has been agreed," its foreign minister said at the news conference in Cairo.
Israel, the top recipient of U.S. assistance, agreed to stop fighting after having gathered troops and armor on the border with Gaza in preparation for a high-risk ground assault.
Netanyahu, in his conversation with Obama, "agreed to his recommendation to give the Egyptian ceasefire proposal a chance, and in this way provide an opportunity to stabilize the situation and calm it before any more forceful action would be necessary", an Israeli statement said.
(Additional reporting by Ori Lewis and Crispian Balmer in Jerusalem, Yasmine Saleh and Shaimaa Fayed in Cairo and Margaret Chadbourn in Washington; Editing by Alastair Macdonald)