Prime Minister Benjamin Netanyahu's office announced the ceasefire and a statement from the security cabinet called the truce "mutual and unconditional".
Hamas said the truce would begin at 2am on Friday (midnight UK time), but Israel has not yet confirmed the time.
The breakthrough came a day after US President Joe Biden called for a "significant de-escalation" and a path to a ceasefire, and followed mediation bids by Egypt, Qatar and the UN.
At least 230 Palestinians have been killed in the fighting, according to Gaza health officials, while 12 in Israel have died.