An Israeli soldier from the Givati brigade carries his gear after returning to Israel from Gaza August 4, 2014. Photo: Reuters
Israel has announced the withdrawal of all of its troops to "defensive positions" outside the Gaza Strip.
The move came moments before the latest truce - brokered by Egyptian mediators late on Monday - came into force at 08:00 local time (05:00 GMT).
Israel claims the main aim of the conflict - to destroy militants' tunnels - has been achieved.
Gaza officials say the four-week conflict has killed 1,800 Palestinians. Some 67 Israelis have also died.
"The Israel Defence Forces will be redeployed in defensive positions outside the Gaza Strip and we will maintain those defensive positions," Israeli military spokesman Lt-Col Peter Lerner said.
Just minutes before the truce came into effect, air raid sirens sounded in Jerusalem and Tel Aviv as Hamas militants fired a barrage of rockets at central Israel. Israeli forces also staged raids in Gaza shortly before the ceasefire began.
Israel launched Operation Protective Edge on 8 July with the stated aim of ending rocket attacks and destroying tunnels used by Palestinian militants.
In a statement just ahead of the withdrawal, the Israel Defence Forces said that since then it had taken out 32 tunnels designed to allow militants to carry out raids into Israel, destroyed 3,000 missiles and killed about 900 "terrorists".
The young son of Abraham Wallace stands next to his covered body along with other ultra-Orthodox Jews at Wallace's funeral in Jerusalem's Mea Shearim neighbourhood August 4, 2014. Photo: Reuters
There have been several truces called during the conflict but few have lasted, with each side accusing the other of violations.
Egypt negotiated a similar truce earlier in the conflict that was accepted by Israel but rejected by Hamas.
The new agreement proposes that delegations from all sides should attend further talks in Cairo.
The main Palestinian demands remain on the table, notably a full Israeli troop withdrawal from Gaza, the end of the blockade of the territory and the opening of border crossings.
Israeli Prime Minister Benjamin Netanyahu said again on Monday that Israel's main goal was to "return quiet and security to the citizens of Israel".
UN Secretary General Ban Ki-moon has welcomed the ceasefire, and he called on both sides to hold talks in Egypt to begin as soon as possible.