UN Special Coordinator for the Middle East Peace Process Robert Serry asked Israel for a humanitarian ceasefire following an incident in which four Palestinian children were killed on a beach in Gaza.
The two sides agreed to the ceasefire to allow Palestinians to stock up on food, water and other necessities.
During the lull in fighting, air raid sirens went off briefly in southern Israel and the truce appeared to be generally holding.
"Factions of the resistance have agreed to accept the offer of the UN regarding a 'field calm' for 5 hours from 10 AM until 3 PM (local time) Thursday for humanitarian needs," Hamas spokesman Sami Abu Zhuri said in a text message.
Israel had already accepted the proposal, however, its military warned it would not sit idle if attacked.
"Should the humanitarian window be exploited by Hamas or other terror organisations for the purpose of launching attacks against Israeli civilian or military targets the IDF will respond firmly and decisively," the Israel Defense Forces said in a statement.
Hamas leaders said they had not been consulted, and complained the deal did not address their demands for greater freedom for Gaza's 1.8 million residents.
Before today's temporary truce, hostilities continued this morning with Israel's airstrikes, taking the death toll to 230 killed and 1,678 wounded, Gaza medical services said.
Israeli tank fire killed three people in Rafah town in Gaza. Their deaths came after another seven people were killed overnight.
Palestinian President Mahmud Abbas was to meet Egyptian President Abdel Fattah al-Sisi today amid intensifying efforts to end the fighting in Gaza, Egypt's presidency announced.
Abbas held talks in Cairo yesterday, as did Quartet envoy Tony Blair, in an effort to reach a mutually acceptable deal.
Abbas met with Hamas official Musa Abu Marzouk, and Egypt, Qatar, Turkey, and even Tunisia and France were reportedly involved in efforts to quell the violence.
President Barack Obama also backed Egypt's efforts to broker a ceasefire, offering the US' full diplomatic support.
