* Talks on a longer-term truce under way in Cairo
* Kerry says militants must give up rockets
* Hamas, Israel warn each other to stick to truce and meet demands (Adds Hamas threat, Egypt comment, Israel lifts wartime status, Netanyahu remarks)
By Nidal al-Mughrabi and Yasmine Saleh
GAZA/CAIRO, Aug 6 (Reuters) - A Gaza ceasefire was holding on Wednesday as Egyptian mediators pursued talks with Israeli and Palestinian representatives on an enduring end to a war that has devastated the Islamist Hamas- dominated enclave.
Egypt's intelligence chief met a Palestinian delegation in Cairo, the state news agency MENA said, a day after he conferred with Israeli representatives. The Palestinian team, led by an official from Western-backed President Mahmoud Abbas's Fatah party, includes envoys from Hamas and the Islamic Jihad group.
"The indirect talks between the Palestinians and Israelis are moving forward," one Egyptian official said, making clear that the opposing sides were not meeting face to face. "It is still too early to talk about outcomes but we are optimistic."
Israel's delegation to the talks arrived in Cairo later on Wednesday, sources at the airport in the Egyptian capital said.
Egypt's Foreign Minister Sameh Shukri told reporters his country was working hard for a deal and sought "solutions to protect the Palestinian people and their interests."
But a senior official with Hamas's armed wing said the group may quit the Cairo talks if progress was not made toward meeting its main demands to lift a blockade on Gaza and free Palestinian prisoners.
"Unless the conditions of the resistance are met the negotiating team will withdraw from Cairo and then it will be up to the resistance in the field," a senior commander of Hamas's armed wing told Reuters, speaking on condition of anonymity.
Israel's military chief, Lieutenant-General Benny Gantz, said in televised remarks that should Hamas disrupt the calm "we will not hesitate to continue to use our force wherever necessary and with whatever force necessary to ensure the security of Israeli citizens near and far."
Egyptian and Palestinian sources said they expected an initial response by Israel to the Palestinian demands, which it has so far shown no signs of accepting, later on Wednesday.
Israel withdrew ground forces from the Gaza Strip on Tuesday morning and started a 72-hour Egyptian-brokered ceasefire with Hamas as a first step towards a long-term deal.
It showed signs of expecting the truce to last by lifting official emergency restrictions on civilians living in the country's south, permitting more public activities and urging everyone to resume their routines.
Streets in towns in southern Israel, which had been under daily rocket fire from the Gaza Strip, were filled again with playing children. The military said that a rocket-warning siren that sounded in the south in the afternoon was a false alarm.
In Gaza, where some half-million people have been displaced by a month of bloodshed, some residents left U.N. shelters to trek back to neighbourhoods where whole blocks have been destroyed by Israeli shelling and the smell of decomposing bodies fills the air.
Palestinians want an end to the Israeli-Egyptian blockade on impoverished Gaza and the release of prisoners, including those Israel arrested in a June crackdown in the occupied West Bank after three Jewish seminary students were kidnapped and killed.
Israel has resisted those demands.
"For Israel the most important issue is the issue of demilitarisation. We must prevent Hamas from rearming, we must demilitarise the Gaza Strip," Mark Regev, a spokesman for Prime Minister Benjamin Netanyahu, told Reuters television.
U.S. Secretary of State John Kerry, in an interview on the BBC's HARDtalk programme, also spoke of a need for Hamas to decommission its rocket arsenal.
"What we want to do is support the Palestinians and their desire to improve their lives and to be able to open crossings and get food in and reconstruct and have greater freedom," Kerry said.
"But that has to come with a greater responsibility towards Israel, which means giving up rockets, moving into a different plane," he said.
Kerry said, however, all this would "finally come together" as part of wider Israeli-Palestinian peace efforts that he has spearheaded but which have been frozen since April over Israel's opposition to a unity deal between Hamas and Abbas's Palestine Liberation Organization.
Hamas, which rules Gaza, has ruled out giving up its weapons.
An Israeli official, who declined to be identified, said Israel wanted humanitarian aid to flow to the Palestinian enclave's 1.8 million inhabitants as soon as possible.
But, the official said, the import of cement - vital for reconstruction - would depend on achieving guarantees that it would not be used by militants to construct more infiltration tunnels leading into Israel and other fortifications.
Gaza officials say the war has killed 1,867 Palestinians, most of them civilians. Israel says 64 of its soldiers and three civilians have been killed since fighting began on July 8, after a surge in Palestinian rocket launches.
An Israeli opinion poll, conducted after the ceasefire went into effect, said Israelis, while not regarding the Gaza war as a victory for their country's powerful military, remained highly supportive of Netanyahu.
According to the poll in the Haaretz newspaper, 51 percent of those surveyed said neither side won, while 36 percent believe that Israel emerged victorious. Six percent said Hamas was the victor.
Of the 442 people who took part in the poll, 77 percent described Netanyahu's performance during the war as excellent or good.
Efforts to turn the ceasefire into a lasting truce could prove difficult, with the sides far apart on their central demands, and each rejecting the other's legitimacy. Hamas rejects Israel's existence and vows to destroy it, while Israel denounces Hamas as a terrorist group and eschews any ties.
Egypt has positioned itself as a mediator in successive Gaza conflicts but, like Israel, its current administration views Hamas as a security threat.
Besides the loss of life, the war has cost both sides economically. Gaza faces a massive $6-billion price tag to rebuild devastated infrastructure. Israel has lost hundreds of millions of dollars in tourism and other sectors and fears cuts in overall economic growth this year as well.
Palestinian officials said a donor conference to raise funds for Gaza's reconstruction would be held in Oslo next month.
(Additional reporting by Ali Sawafta in Ramallah, Ori Lewis in Jerusalem and Maggie Fick in Cairo; Writing by Jeffrey Heller in Jerusalem; Editing by Giles Elgood and Sonya Hepinstall)