* Gaza truce to expire at 2100 GMT, gaps still wide
* Israel warns Gaza militants against renewed attacks
* Gaza's dominant Hamas says Israel must lift blockade (Adds Israeli arrests of Hamas activists)
By Nidal al-Mughrabi and Stephen Kalin
GAZA/CAIRO, Aug 18 (Reuters) - Talks in Cairo on ending the Gaza war showed no signs of a breakthrough on Monday, with Israel and the Palestinians entrenched in their demands hours before the expiry of a five-day ceasefire.
The truce is due to run out at 2100 GMT. A Palestinian source quoted by Egypt's state news agency MENA said Egyptian mediators were making "a big effort to reach an agreement in the coming hours".
Both sides said gaps remained in reaching a long-term deal that would keep the peace between Israel and militant groups in the Gaza Strip, dominated by Hamas Islamists, and allow reconstruction aid to flow in after five weeks of fighting.
Israeli Justice Minister Tzipi Livni addressed the prospect of renewed hostilities, while signalling that Israel would continue to hold its fire as long as Palestinians did the same.
"If they shoot at us, we will respond," Livni, a member of Prime Minister Benjamin Netanyahu's security cabinet, told Israel Radio.
The Palestinian Health Ministry put the Gaza death toll at 2,016 and said most were civilians in the small, densely populated coastal territory. Sixty-four Israeli soldiers and three civilians in Israel have been killed.
Late on Sunday, a Palestinian official said Israel's position in the talks, as presented to them by Egyptian mediators, was a "retreat from what had already been achieved and discussions had returned to square one".
The official, who was not named, told MENA that Israel had toughened its stance and had presented "impossible" demands, particularly on security issues. He said the Palestinians would review the situation and offer their response on Monday.
"We are determined to achieve the demands of our people and foremost is ending the aggression and launching the rebuilding process and lifting the Israeli-imposed blockade of the Gaza Strip," MENA quoted the official as saying.
Netanyahu said on Sunday that any deal on the territory's future had to meet Israel's security needs. He warned Hamas it faced "harsh strikes" if it resumed its attacks.
Hamas also seeks the construction of a Gaza sea port and the reopening of an airport destroyed in previous conflicts, as part of any enduring halt to violence. Livni said such issues should be dealt with at a later stage.
Israel, which launched its offensive on July 8 after a surge in Hamas rocket fire across the border, has shown scant interest in making sweeping concessions, and has called for the disarming of militant groups in the enclave of 1.8 million people.
Hamas has said that laying down its weapons is not an option.
In Jerusalem, the Shin Bet internal security agency said it had arrested 93 Hamas activists in the occupied West Bank over the past three months who had planned to carry out "serious attacks" in Israel, aiming to destablise the region and eventually topple the Western-backed Palestinian Authority.
The Shin Bet allegations of a planned coup, in a statement that said Israeli authorities had confiscated 30 guns, seven rocket launchers and $170,000 from the group, were met with scepticism by Israeli media commentators.
"Would they have been able to do this? I don't know," Roni Daniel, the well-connected military affairs correspondent for Israel's Channel Two television, said on-air.
Barak Ravid, the Haaretz newspaper's diplomatic affairs reporter, tweeted: "Israeli Shin Bet claims Hamas tried to take over the West Bank with 6 pistols, 7 RPG launchers and 20 M16 guns. Yeah right."
The Gaza offensive has had broad public support in Israel, where militants' rockets, many of them intercepted by the Iron Dome anti-missile system, have disrupted everyday life but caused little damage and few casualties. By contrast, Israeli bombardment of Gaza has wrought widespread destruction.
The United Nations said 425,000 people in the Gaza Strip have been displaced by the conflict.
Israel and Hamas have not met face-to-face in Cairo, where the talks are being held in a branch of the intelligence agency, with Egyptian mediators shuttling between the parties in separate rooms. Israel regards Hamas, which advocates its destruction, as a terrorist group.
In Gaza, Pierre Krähenbühl, head of the United Nations Relief and Works Agency, said he hoped ceasefire talks would lead to substantial change on the ground.
"There has to be a message of hope for the people of Gaza, there has to be a message for something different, there has to be a message of freedom for the people, freedom to move, freedom to trade," Krähenbühl told reporters. (Additional reporting by Maggie Fick in Cairo; Writing by Jeffrey Heller in Jerusalem; editing by Ralph Boulton)