"The resistance has triumphed," some shouted, alongside chants of "Allahu akbar (God is greatest)."
Foreign Minister Mohammed Kamel Amr of Egypt, which brokered the ceasefire after marathon talks, announced the cessation of hostilities at a joint news conference in Cairo with US Secretary of State Hillary Clinton.
The accord, a copy of which was obtained by AFP, calls on Israel to "stop all hostilities... in the land, sea and air including incursions and targeting of individuals" and urges the Palestinian factions to end "rocket attacks and all attacks along the border".
If it holds, within 24 hours, Israel would be required to start implementing procedures to open Gaza's border crossings and allow the movement of people and goods.
"This is a critical moment for the region," Clinton said. "In the days ahead, the United States will work with partners in the region to consolidate this progress."
Nearly 24 hours after a truce had been expected to take hold, and after a day of violence that killed another 18 Palestinians, Israeli Prime Minister Benjamin Netanyahu's office said he was prepared to give peace a chance.
"Netanyahu spoke with (US) President Barack Obama and agreed to his recommendation to give a chance to an Egyptian proposal for a ceasefire and thereby give an opportunity for the stabilisation of the situation and a calming of it," said a statement.
It won him praise from Obama.
"The president commended the prime minister for agreeing to the Egyptian ceasefire proposal, which the president recommended the prime minister do, while reiterating that Israel maintains the right to defend itself," the White House said.
The UN Security Council called on Israel and Hamas to "act seriously" to maintain their tentative ceasefire and joined praise for Egypt's President Mohamed Morsi for halting the violence.
The 15-member council also called in a statement for an international effort to get "emergency aid" into Gaza.
There had to be "expeditious and unimpeded delivery of such humanitarian assistance, including of food, fuel and medical treatment," said the statement.
Obama, re-elected this month, led a chorus of approval for Morsi's mediation work.
"The president thanked President Morsi for his efforts to achieve a sustainable ceasefire and for his personal leadership in negotiating a ceasefire proposal," the White House said.
European Union leaders Jose Manuel Barroso and Herman Van Rompuy also welcomed the ceasefire while stressing that the parties must "ensure its implementation and to prevent the restart of violence."
The exiled chief of Hamas, which rules Gaza, said Israel had "failed in all its goals" and thanked Iran for supporting his Islamist movement during the conflict.
"After eight days, God stayed their hand from the people of Gaza, and they were compelled to submit to the conditions of the resistance," Khaled Meshaal said in Cairo.
The agreement came after a day of shuttle diplomacy led by Clinton and UN Secretary General Ban Ki-moon, who said that details of the deal still needed to be ironed out.
"There are still many details to be solidified for a durable ceasefire. I hope they will finalise these details as soon as possible," he said in Amman, Jordan.
Truce hopes appeared faint just hours before as a blast tore through a bus in Tel Aviv, and Israel hit back with deadly raids on Gaza City and elsewhere in the coastal Palestinian territory.
The blast, which injured 17 people, occurred close to the Israeli defence ministry and was quickly denounced by Netanyahu's spokesman, who tweeted: "This was a terrorist attack".
Soon after, another six Palestinians were killed in air strikes on Gaza City
Israel launched its offensive on November 14 with the targeted killing of a Hamas military chief. It has since hit more than 1,500 targets.
Gaza militants fired more than 1,500 rockets back at Israel, whose vaunted Iron Dome anti-missile system intercepted more than 420 of them.
Twelve rockets fired from the Gaza Strip hit Israel on Wednesday in the hours that followed the ceasefire agreement, a police spokesman told AFP. The attacks caused no injuries or damage, with the rockets mostly landing in open fields in the south of the Jewish state.
At least 155 Palestinians have been killed in the conflict, and five Israelis have died.
The conflict came as Israel heads towards a general election in January, and raised the spectre of a broader military campaign along the lines of the Jewish state's devastating 22-day operation launched at the end of December 2008.