* 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
A ceasefire between Israel and Gaza's Hamas rulers took hold on Thursday after eight days of conflict, although deep mistrust on both sides cast doubt on how long the Egyptian-sponsored deal can last.
Even after the ceasefire came into force late on Wednesday, a dozen rockets from the Gaza Strip landed in Israel, all in open areas, a police spokesman said. In Gaza, witnesses reported an explosion shortly after the truce took effect at 9 p.m (1900 GMT), but there were no casualties and the cause was unclear.
The deal prevented, at least for the moment, an Israeli ground invasion of the Palestinian enclave following bombing and rocket fire that killed five Israelis and 162 Gazans, including 37 children.
But 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.
Both sides quickly began offering differing interpretations of the ceasefire, brokered by Egypt's new Islamist government and backed by the United States, highlighting the many actual or potential areas of discord.
If the truce holds, it will give the 1.7 million Gazans respite from days of ferocious air strikes and halt rocket salvoes from militants that have unnerved a million people in southern Israel and reached Tel Aviv and Jerusalem for the first time.
"Allahu akbar, (God is greatest), dear people of Gaza you won," blared mosque loudspeakers in Gaza as the truce took effect. "You have broken the arrogance of the Jews."
Fifteen minutes later, wild celebratory gunfire echoed across the darkened streets, which gradually filled with crowds waving Palestinian flags. Ululating women leaned out of windows and fireworks lit up the sky.
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".
Some Israelis staged protests against the deal, notably in the southern town of Kiryat Malachi, where three people were killed by a Gaza rocket during the conflict, army radio said.
Netanyahu, already taking political flak from an Israeli opposition that had rallied to him during the Gaza fighting, said he was willing to give the truce a chance but held open the possibility of reopening the conflict.
"I know there are citizens expecting a more severe military action, and perhaps we shall need to do so," he said.
The rightist Israeli leader, who faces a parliamentary election in January, delivered a similar message earlier in a phone call with U.S. President Barack Obama, his office said.
"A PIECE OF PAPER"
According to a text of the ceasefire 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. "The document stipulates the opening of the crossings, all the crossings, and not just Rafah," he said. Israel controls all of Gaza's crossings apart from the Rafah post with Egypt.
Interviewed on Israel's Army Radio, Defence Minister Ehud 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 inside of the Gaza border that they have said prevents armed infiltration.
"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 (boundary) 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."
Hamas lost its top military commander to an Israeli strike in the conflict and suffered serious hits to its infrastructure and weaponry, but has emerged with its reputation both in the Arab world and at home stronger.
Israel can take comfort from the fact that it dealt painful blows to its enemy, from which Hamas will take many months to recover, and showed it can defend itself from a barrage of missiles.
"No one is under the illusion that this is going to be an everlasting ceasefire," said former Barak aide Michael Herzog.
"But there is a chance that it could hold for a significant period of time, if all goes well," he told Reuters.
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 its sympathies for Hamas, an offshoot of the Muslim Brotherhood to which President Mohamed Mursi belongs, and its need to preserve 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.
"This is a critical moment for the region," Clinton said. "Egypt's new government is assuming the responsibility and leadership that has long made this country a cornerstone for regional stability and peace."
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.
In his call with Netanyahu, Obama repeated the U.S. commitment to Israel's security and promised to seek fresh funds for a joint missile defence programme, the White House said.
The ceasefire was forged despite a bus-bomb explosion that wounded 15 Israelis in Tel Aviv earlier in the day and despite more Israeli air strikes that killed 10 Gazans. It was the first serious bombing in Israel's commercial capital since 2006.
In Amman, U.N. chief Ban Ki-moon urged both sides to stick to their ceasefire pledges. "There may be challenges implementing this agreement," he said, urging "maximum restraint".
Israel, the United States and the European Union all classify Hamas as a terrorist organisation. It seized the Gaza Strip from the Western-backed Palestinian President Mahmoud Abbas in 2007 in a brief but bloody war with his Fatah movement.