The agreement, announced in Egypt on Wednesday night by Foreign Minister Mohammed Kamel Amr and US Secretary of State Hillary Clinton, calls on Israel to "stop all hostilities... in the land, sea and air, including incursions and targeting of individuals."
It urges Palestinian militant groups to end "rocket attacks and all attacks along the border."
In Gaza, streets which had been emptied by Israel's intensive air strikes were once again flooded with honking cars and people back to their daily business.
After days and nights cooped up at home, residents were out en masse waving flags and exchanging handshakes and smiles following a night of celebratory gunfire and fireworks.
The ruling Hamas movement declared a public holiday to mark the end of hostilities, and organised a mass celebration in the centre of Gaza City.
"I salute the resistance factions who have respected the agreement since it entered into force and I ask everyone to respect it and act accordingly," Haniya said as thousands waved flags outside the parliament building.
His office said president Mahmud Abbas, of the rival Fatah movement, had spoken by telephone with Haniya to congratulate him on his "victory."
Parents carried children with the words "Hamas" in green and "Fatah" in yellow painted on their cheeks, and some waved the flags of both movements in a rare show of unity in the Hamas-run territory.
"The thing I'm happiest about is that the Palestinian people seem to be coming together. This, I think, is the best and most beautiful outcome of a terrible war," said a smiling Yusef Jdeidah, 60.
Both sides claimed the ceasefire as a victory, warning they would be ready to resume fire should the other violate the agreement.
"Israel has failed in all its goals," Hamas chief Khaled Meshaal said in Cairo on Wednesday. "If you commit, we will commit. If you do not commit, the rifles are in our hands."
Israel's armed forces chief of staff Lieutenant General Benny Gantz hailed the campaign, saying it had "accomplished its purposes and goals."
"We hit Hamas hard," he said, adding the operation had inflicted "great damage" on Hamas's rocket-launching capabilities.
Head of the defence ministry policy department Amos Gilad insisted that the agreement didn't prevent Israel from targeting militants.
"If you're talking about targeted killing, there's freedom of activity to carry it out," he told public radio, specifying instances in which "someone's about to kill" and is prevented from doing so.
"Israel has not relinquished any freedom of activity in protecting itself, a right anchored in international law."
Netanyahu warned Israel was ready should the truce collapse.
"We are currently giving the ceasefire a chance, but are also prepared for the possibility the ceasefire will not be kept, and we'll know to act accordingly," he said.
But the tone was far from celebratory.
And with just two months until a general election, it was back to the campaign trail for politicians, many of whom were quick to accuse Netanyahu of failing to keep an old pledge to bring down Hamas.
"Deterrence was not restored," said Shaul Mofaz, head of the centre-right Kadima party. "We shouldn't have stopped the operation at this stage. The ceasefire is a mistake," he told army radio.
The mass-circulation Yediot Aharonot newspaper said the Cairo agreement "will lead to a certain period of quiet in the south" but it was only a matter of time before the border heated up again.
During the eight eight-day operation, the army said it hit more than 1,500 targets, as Gaza militants fired 1,354 rockets over the border, 421 of which were intercepted by the Iron Dome defence system.
The Hamas-run health ministry said 163 Palestinians had been killed and 1,235 wounded, while six people, including a soldier and a reserve officer, were killed in Israel and another 280 wounded, army figures showed.
Israel's domestic security service Shin Beth announced that those responsible for a rush-hour us bomb that left 29 people wounded in Tel Aviv last week had been arrested.