The proposal by US President Donald Trump's envoy, Steve Witkoff, was agreed to early on Sunday, hours after the first phase of the previously agreed ceasefire was set to expire.
On the first day half of the hostages held in Gaza, both alive and dead, would be released, Prime Minister Benjamin Netanyahu's office said.
The remaining hostages would also be released after a permanent ceasefire was agreed.
Witkoff made the proposal to extend the current ceasefire after realising more time was needed for talks on a permanent ceasefire, Netanyahu's office added.
Hamas spokesperson Hazem Qassem earlier on Saturday said the group rejected Israel's "formulation" of extending the first phase of the ceasefire in Gaza, but did not explicitly mention Witkoff's plan.
Netanyahu's office said Israel would immediately conduct negotiations on Witkoff's plan if Hamas agreed to it.
"According to the agreement, Israel can return to fighting after the 42nd day if it feels that the negotiations are ineffective," Netanyahu's office also said, accusing Hamas of violating the deal. Both sides have been trading accusations of violating the deal.
The ceasefire agreement reached in January halted 15 months of fighting, allowing the exchange of 33 Israeli hostages and five Thais for around 2000 Palestinian prisoners and detainees. It was meant to lead to subsequent talks to build on the ceasefire deal.
Talks about the ceasefire have been ongoing, most recently in Cairo, but have not led to an agreement.Â