The agreement, which came into effect at 1600 GMT, involves an immediate halt to the violence in Gaza, which began on July 8 and has claimed the lives of 2,143 Palestinians and 69 on the Israeli side.
The number includes an Israeli who was killed by a mortar round in the last hour before the fighting stopped.
The Palestinians said it was a "permanent" truce, while a senior Israeli official described it as "unconditional and unlimited in time."
As the ceasefire took hold, thousands of Palestinians flooded on to the streets of Gaza City, some firing joyfully into the air, among them gunmen from Hamas, AFP correspondents said.
Mosques used their loudspeakers to broadcast celebratory chants of "God is greatest" as the war-torn enclave hailed the apparent end to seven weeks of violence that has seen a quarter of the territory's 1.8 million people flee their homes.
"Thank God the war is ended. I can't believe I'm still alive with my kids!" 32-year-old Maha Khaled told AFP.
"It was a very harsh war. I never thought that we would see peace at the end."
Others in the territory where the Islamist Hamas movement is the dominant power, hailed the truce as a victory for the Palestinian resistance over Israel.
"Thank God! The resistance won!" said Tamer al-Madqa, 23.
"Today Gaza showed the world that it is resisting and that it is stronger than Israel."
- 'Ending the blockade' -
News of the agreement first emerged from the West Bank city of Ramallah where a Palestinian official told AFP an elusive deal had been reached over a "durable" halt to more than seven weeks of bloodshed and violence in and around Gaza.
Hamas hailed the deal as a "victory for the resistance."
The official told AFP the agreement involved "a permanent ceasefire, a (deal to) end the blockade and a guarantee that Gaza's demands and needs will be met," but gave few other details.
Ending Israel's crippling eight-year blockade of Gaza had been a key Palestinian demand in earlier, abortive truce talks in Cairo.
The formal announcement came from Palestinian president Mahmud Abbas in a live speech at his headquarters in the West Bank city of Ramallah.
Shortly afterward, Israel confirmed its acceptance of the deal, saying the negotiating teams would return to Cairo "within a month" but without saying when.
"We have accepted, once again, an Egyptian proposal for an unconditional and unlimited-in-time ceasefire," a senior official said.
"The framework includes an immediate and unconditional ceasefire and then, inside a month, both delegations will be in Cairo raising issues with the Egyptians," he said.
"We will be raising our concerns about demilitarisation and preventing Hamas from rearming and they will be raising their concerns. This is the framework that has been on the table for weeks now."
- Crossings to open -
In a statement, the Egyptian foreign ministry said there would be an immediate opening of Israeli border crossings to allow in both aid and reconstruction supplies.
Alongside a comprehensive ceasefire, the two sides agreed to the "simultaneous opening of the border crossings between Israel and Gaza to enable the rapid entry of humanitarian aid and relief and reconstruction supplies," a statement said.
The Egyptian-brokered deal also provides for the immediate extension to six nautical miles of the area open to Gaza's fisherman working the seas off the coastal enclave.
It also refers to the "continuation of indirect negotiations between the two sides on other matters within one month of the ceasefire taking effect."
News of the reported deal came after weeks of Egyptian-led efforts to end the violence.
There have been several short-term ceasefires between the two sides, which brought relief to millions of civilians, but they all broke down in the absence of any agreement on a longer-term truce.
The latest collapsed on August 19 as hostilities resumed, killing more than 120 Palestinians and two Israelis, one a four-year-old child.
- Israeli killed by mortar fire -
There had been no sign of any letup in the fighting earlier on Tuesday, with 12 Palestinians killed in Israeli air strikes and tank shelling, among them two children.
And on the other side of the border, an Israeli was killed and two others seriously wounded when a mortar round struck next to a swimming pool in a kibbutz close to the frontier.
Israel also bombed two high rises in Gaza City, wounding 40 people. One was a 16-storey complex in which there were 60 flats and a shopping centre, while the second was a 14-storey residential block.
The army said they had housed "Hamas command and control centres" but Hamas denounced the move as a "war crime aimed at terrorising the people."
The military also confirmed striking two schools in central and northern Gaza from which "low-trajectory fire" had been directed at Israel.