Under the deal, Israel has agreed to end all hostilities and targeted killings, while Hamas will stop attacks against Israel and along the border.
At least 157 people have died since the flare-up of violence began last week.
Both sides continued to fire on each other as the 21:00 ceasefire deadline approached, but no incidents have been reported since.
Earlier, a bomb exploded on a bus in the Israeli city of Tel Aviv, leaving three people needing surgery.
Wednesday also saw at least 13 people die in Gaza.
Israel has agreed to “stop all hostilities on the Gaza Strip, land, sea and air including incursions and targeting of individuals”, the ceasefire deal says.
“All Palestinian factions shall stop all hostilities from the Gaza Strip against Israel, including rocket attacks, and attacks along the border,” it stipulates.
Egyptian Foreign Minister Kamel Amr announced the ceasefire at a news conference in Cairo with US Secretary of State Hillary Clinton, who joined negotiations on Wednesday.
A statement from the office of Israeli Prime Minister Benjamin Netanyahu said he had agreed to a US suggestion “to give a chance to Egypt’s proposal for a ceasefire and so give an opportunity to stabilize the situation and calm it before there will be need to apply greater force”.
For the truce to hold, Hillary Clinton said, “the rocket attacks [from Gaza] must end and a broader calm must return”.
“Now we have to focus on reaching a durable outcome that promotes regional stability and advances the security, dignity and legitimate aspirations of Palestinians and Israelis alike,” she added.
US President Barack Obama praised the Israeli leader for accepting the deal and said he would seek additional funding for the Iron Dome missile defence system, which destroyed dozens of rockets from Gaza in mid-air during the past week.
Barack Obama also thanked Egyptian President Mohammed Mursi for his efforts.
Ties between Hamas and Egypt have strengthened since Mohammed Mursi was elected earlier this year. Hamas was formed as an offshoot of the Muslim Brotherhood, to which Mohammed Mursi belongs.
Also on Wednesday, Palestinian militants fired more rockets at Israel, while Israel renewed its naval artillery bombardment of Gaza.
Israel launched its current offensive a week ago with the killing of Hamas military leader Ahmed Jabari.
The Israeli government says his assassination, and the subsequent offensive, were aimed at ending rocket fire from Gaza.
More than 150 Palestinians and five Israelis have since been killed.
Israeli officials described Wednesday’s bus explosion as a “terrorist attack”. Hamas praised it but has not said it was behind the blast.
1Tw8Tnr1VMs JpiOIiOzBsAImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…