It is intended to come into effect at 19:00 GMT (21:00 local time), the officials say. Similar predictions on Tuesday failed to produce a deal.
Earlier, a bomb exploded on a bus in the Israeli city of Tel Aviv, leaving three people needing surgery.
Wednesday saw at least 13 die in Gaza.
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.
The details of the deal are not yet clear, says the BBC’s Middle East editor Jeremy Bowen.
Israel’s demands included an end to hostile fire of any kind from Gaza and international efforts to prevent Hamas from re-arming. For its part, Hamas wanted an end to the blockade on Gaza and targeted killings by Israel.
Israel has accepted the deal, according to a statement from the office of Prime Minister Benjamin Netanyahu.
Mr Netanyahu consulted US President Barack Obama before agreeing to the ceasefire.
Mr Netanyahu’s office said he had accepted Mr Obama’s “suggestion to give a chance to Egypt’s proposal for a ceasefire and so give an opportunity to stabilise the situation and calm it before there will be need to apply greater force”.
For the truce to hold, Mrs 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 said.
Mr 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.
He also thanked Egyptian President Mohammed Mursi for his efforts.
Ties between Hamas and Egypt have strengthened since Mr Mursi was elected earlier this year. Hamas was formed as an offshoot of the Muslim Brotherhood, to which Mr 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.
More than 150 Palestinians and five Israelis have since been killed.