The ceasefire, which came into force at 9pm (1900 GMT) last night, was announced in Cairo by Egyptian Foreign Minister Mohamed Kamel Amr.
The truce gives 1.7 million Palestinians respite from days of ferocious airstrikes and halts 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.
Mr Amr said mediation efforts had "resulted in understandings to cease fire, restore calm and halt the bloodshed".
US Secretary of State Hillary Clinton thanked Egypt's new Islamist President Mohamed Mursi for his peace efforts, saying his government was assuming responsibility and leadership in the region.
Israeli Prime Minister Benjamin Netanyahu told US President Barack Obama he was ready to give the ceasefire a chance, but "more forceful action" might be needed if it failed, according to a statement from his office.
Mr Obama in turn reiterated his country's commitment to Israel's security and pledged to seek funds for a joint missile defence programme, the White House said.
Senior Hamas politician 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 historic victory against the occupation and laid the foundation for the battle of liberation of the full land and sacred sites," said Mr Bahar, deputy speaker of the Palestinian parliament.
The agreement requires both sides to halt all hostilities, with Israel desisting from incursions and targeting of individuals, and Palestinian factions ceasing rocket fire and cross-border attacks.
The deal also provides for easing Israeli restrictions on Gaza's residents, who live in what 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 after more Israeli airstrikes killed 10 Gazans.
The Tel Aviv blast, near the Israeli Defence Ministry, prompted celebratory gunfire from militants in Gaza and 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 1500 strikes since the offensive began with the killing of a top Hamas commander and 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 1400 rockets have been fired into Israel, killing four civilians and a soldier, the military said.
Egypt, a longstanding US ally now under Islamist leadership after last year's overthrow of Hosni Mubarak, took centre 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," Mrs 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."