* Gaps remain in Cairo talks on ending Gaza war
* Hamas warns of "long war" if group's demands not met
* Netanyahu says won't be forced into concessions
* Five-day ceasefire runs out late on Monday (Adds Hamas negotiator, Palestinian president)
By Nidal al-Mughrabi and Jeffrey Heller
GAZA/JERUSALEM, Aug 17 (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.
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.
Egypt, which is mediating between the sides and, like Israel, views Hamas as a security threat, has given little detail of any progress in the talks.
"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 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.
Israeli Communications Minister Gilad Erdan, a member of Netanyahu's security cabinet, 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. (Writing by Jeffrey Heller; additional reporting by Maggie Fick in Cairo; editing by Andrew Roche)
Our Standards: The Thomson Reuters Trust Principles.