GAZA/JERUSALEM (Reuters) - Prime Minister Benjamin Netanyahu said on Sunday any deal on Gaza's future had to meet Israel's security needs, warning Hamas it faced "harsh strikes" if it resumed firing into the Jewish state.

With a five-day ceasefire due to expire late on Monday, negotiators returned after consultations to Cairo to seek an end to five weeks of hostilities that have killed more than 2,000 people.

Both sides say gaps remain in reaching a long-term deal that would keep the peace between Israel and militant groups in the Hamas Islamist-dominated Gaza Strip, and open the way for reconstruction aid to reach the battered enclave.

Late on Sunday, a Palestinian official said Israel's position in the talks, as presented to them by Egyptian mediators, were a "retreat from what had already been achieved and discussions had returned to square one."

The official, who was not named, told Egypt's official news agency MENA that Israel had toughened its stance and had placed "impossible" demands, particularly on security issues. He said the Palestinians would review the situation and would offer their response early 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.

Moussa Abu Marzouk, a senior Hamas official at the talks, said there was no certainty the ceasefire would continue beyond its Monday night deadline.

"There are 24 hours left for the agreed calm period and it may not be renewed. The Palestinian delegation will not cede any of the rights of our people," he told a Hamas web site.

Hamas wants Israeli and Egyptian blockades of Gaza lifted, as well as the establishment of a seaport and airport, as part of any enduring halt to violence.

Israel, which launched its offensive on July 8 after a surge in cross-border Hamas rocket attacks, has shown scant interest in making sweeping concessions, and has called for the disarming of militant groups in the territory of 1.8 million people.

Netanyahu, in public remarks to his cabinet, said Hamas should not underestimate Israel's resolve to battle on.

"Only if there is a clear response to our security needs will we agree to reach understandings," he said.

"If Hamas thinks that through continued intermittent firing it will cause us to make concessions, it is mistaken. For as long as quiet does not return, Hamas will continue to absorb very harsh strikes."

'WEAPONS OF RESISTANCE'

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.

Commenting on Netanyahu's remarks, Hamas spokesman Sami Abu Zuhri said: "The only way to achieve security is to afford security to the Palestinians first and to lift the blockade and to agree to their demands."

On Saturday, Osama Hamdan, Hamas's foreign affairs chief, said on Facebook: "Israel must accept the demands of the Palestinian people or face a long war."

Izzat el-Reshiq, a Hamas negotiator in Cairo, wrote on Twitter that relinquishing "the weapons of resistance" was not a matter for discussion.

"As of now, Israel has not agreed to any proposals," an Israeli official said on condition of anonymity.

U.S.-backed President Mahmoud Abbas, whose Fatah party was reconciled with Hamas in April and is part of the Palestinian delegation in Cairo, said in a statement: "Our utmost priority now is to stop the fighting, the bloodshed and the destruction in the Gaza Strip."

"The way it is looking now, I think that we will not reach a deal," Israeli Communications Minister Gilad Erdan, a member of Netanyahu's security cabinet, told Israel's Channel 10 News.

DESTRUCTION

The United Nations said 425,000 people in the Gaza Strip have been displaced by the war. The Palestinian Health Ministry in the enclave says 1,980 Palestinians, most of them civilians, have been killed in the conflict.

On the Israeli side, 64 soldiers and three civilians have been killed.

Egyptian and Palestinian sources have said that at the Cairo talks Israel has tentatively agreed to relax curbs on the movement of people and goods across the border, subject to certain conditions.

Erdan said Israel was examining the Egyptian proposal as a whole and had yet to make any final decision. "There are sections that are problematic as far as Israel is concerned," Erdan said on Israel Radio, without elaborating.

The Palestinian demand for a Gaza seaport and reconstruction of an airport destroyed in previous conflicts with Israel has been a stumbling block, with Israel citing security reasons for opposing their operation.

Israel and Hamas have not met face-to-face in Cairo; 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.