* Hamas will respond to Israeli violations -leader
* Tougher Israeli approach possible in future - Netanyahu
* Both sides differ on interpreting deal
* Egyptian diplomacy takes centre-stage
By Nidal al-Mughrabi and Jeffrey Heller
GAZA/JERUSALEM, Nov 22 (Reuters) - A ceasefire between Israel and Hamas took hold on Thursday with scenes of joy among the ruins in Gaza over what Palestinians hailed as a victory, a n d both sides saying their fingers were still on the trigger.
Quiet rei g ned on both sides of the border and Palestinians who had been under Israeli bombardment for eight days poured into the streets of Gaza for a celebratory rally, walking past wrecked houses and government buildings.
But as a precaution, schools stayed closed in southern Israel, where nerves were jangled by warning sirens - a false alarm, the army said - after a constant rain of rockets during the most serious Israeli-Palestinian fighting in four years.
Israel had launched its strikes last week with a declared aim of ending rocket attacks on its territory from Gaza, ruled by the Islamist militant group Hamas which denies Israel's right to exist. Hamas had responded with more rockets.
The truce brokered by Egypt's new Islamist government, working with the United States, prevented - at least for now - an Israeli invasion of Gaza.
Gaza medical officials said 162 Palestinians, more than half of them civilians including 37 children, were killed in the conflict. Nearly 1,400 rockets were fired into Israel, killing four civilians and two soldiers, including an officer who died on Thursday of wounds sustained on Wednesday, the Israeli army said.
Israel's defence minister, Ehud Barak, said it dropped 1,000 times as much explosive on the Gaza Strip as had landed in Israel.
Municipal workers in Gaza began cleaning streets and removing the rubble of buildings bombed in Israel's air strikes. Stores opened and people flocked to markets to buy food.
"Israel learnt a lesson it will never forget," said 51-year-old Khalil al-Rass from Beach refugee camp in the city of Gaza.
Jubilant crowds celebrated in Gaza, in a rare show of Palestinian unity five years after a brief civil war in which Hamas, elected to govern in a 2006 poll, wrested the territory from the rival Fatah movement th at controls the West Bank.
Most of those celebrating on Thursday waved green Hamas flags but there were also hundreds with the yellow emblems of Fatah, led by Western-backed President Mahmoud Abbas.
He phoned Gaza chief and prime minister, Ismail Haniyeh, to "congratulate him on the victory and extend condolences to the families of the martyrs", Haniyeh's office said.
In rocket-hit towns in southern Israel, schools remained closed as a precaution. Nerves were jangled when warning sirens sounded, in what the military quickly said was a false alarm.
Trust was in short supply. The exiled leader of Hamas, Khaled Meshaal, said his Islamist movement would respect the truce if Israel did, but would respond to any violations.
"If Israel complies, we are compliant. If it does not comply, our hands are on the trigger," he told a news conference in Cairo.
Israeli Prime Minister Benjamin Netanyahu said he had agreed to "exhaust this opportunity for an extended truce", but told his people a tougher approach might be required in the future.
Facing a national election in two months, he swiftly came under fire from opposition politicians who had rallied to his side during the fighting but now contend he emerged from the conflict with no real gains for Israel.
"You don't settle with terrorism, you defeat it. And unfortunately, a decisive victory has not been achieved and we did not recharge our deterrence," Shaul Mofaz, leader of the main opposition Kadima party, wrote on his Facebook page.
Israel planned to discharge gradually tens of thousands of reservists called up for a possible Gaza invasion. The first tanks were seen being ferried north, away from the border, on transporters on Thursday.
In a speech, Haniyeh appealed to all Palestinian groups in Gaza to respect the ceasefire and cautioned that the "relevant government and security services" would monitor compliance.
Both sides quickly began offering differing interpretations of the ceasefire, which highlighted the many actual or potential areas of discord.
According to a text of the agreement seen by Reuters, both sides should halt all hostilities, with Israel desisting from incursions and targeting of individuals, while all Palestinian factions should cease rocket fire and cross-border attacks.
The deal also provides for easing Israeli restrictions on Gaza's residents, who live in what British Prime Minister David Cameron has called an "open prison".
The text said procedures for implementing this would be "dealt with after 24 hours from the start of the ceasefire".
Israeli sources said Israel would not lift a blockade of the enclave it enforced after Hamas, which preaches the Jewish state's destruction, won a Palestinian election in 2006.
However, Meshaal said the deal covered the opening of all of the territory's border crossings.
Israel let dozens of trucks carry supplies into the Palestinian enclave during the fighting. Residents there have long complained that Israeli restrictions blight their economy.
Meshaal thanked Egypt for mediating and praised Iran for providing Gazans with financing and arms.
"We have come out of this battle with our heads up high," he said, adding that Israel had been defeated and failed in its "adventure".
Barak said Hamas, which declared Nov. 22 a national holiday, had suffered a heavy military blow, including the death of its top commander, killed in an air strike at the start of the operation on Nov. 14.
"A large part of the mid-range rockets were destroyed. Hamas managed to hit Israel's built-up areas with around a tonne of explosives, and Gaza targets got around 1,000 tonnes," Barak told Israel Radio.
"So whoever misses what is happening in Gaza does not understand that this entire agreement is a paper bridge for the defeated so that they can explain to their public how they can even show their faces after what they were hit with for a week."
Some Israelis staged protests against the deal, notably in the southern town of Kiryat Malachi, where three civilians were killed by a rocket from Gaza last week, army radio said.
Interviewed on Israel's Army Radio, Barak dismissed a ceasefire text published by Hamas as "a piece of paper which I don't remember anyone going around with - there's no signature on it".
He appeared to confirm, however, a key Hamas claim that the Israelis would no longer enforce a no-go zone on the Gaza side of the frontier that the army says has prevented Hamas raids:
"If there are no attacks along the border ... then I tell you that there is no problem with them working the farmland on the perimeter up to the fence," Barak said.
But should the Palestinians exploit such measures to breach the truce, Israel would be "free to act," he said, adding: "The right to self-defence trumps any piece of paper."
Egypt, an important U.S. ally now under Islamist leadership, took centre stage in diplomacy to halt the bloodshed. Cairo has walked a fine line between sympathies for Hamas, an offshoot of the Muslim Brotherhood that produced President Mohamed Mursi and much of his government, and preserving its 1979 peace treaty with Israel and its ties with Washington, its main aid donor.
Announcing the agreement in Cairo, Egyptian Foreign Minister Mohamed Kamel Amr said mediation had "resulted in understandings to cease fire, restore calm and halt the bloodshed".
U.S. Secretary of State Hillary Clinton, standing beside Amr, thanked Mursi for peace efforts that showed "responsibility, leadership" in the region.
Gaza erupted in a Middle East already shaken by last year's Arab revolts that toppled several veteran U.S.-backed leaders, including Egypt's Hosni Mubarak, and by a civil war in Syria, where President Bashar al-Assad is fighting for survival.
Israel, the United States and the European Union all classify Hamas as a terrorist organisation. But its stance is popular with many Palestinians and has kept the movement competitive with Fatah.