JERUSALEM, May 5 (Reuters) - Prime Minister Benjamin Netanyahu hardened his rejection of Hamas demands for an end to the Gaza war in exchange for the freeing of hostages, saying on Sunday that would keep the Palestinian Islamist group in power and pose a threat to Israel.

Netanyahu said Israel was willing to pause fighting in Gaza in order to secure the release of hostages still being held by Hamas, believed to number more than 130.

"But while Israel has shown willingness, Hamas remains entrenched in its extreme positions, first among them the demand to remove all our forces from the Gaza Strip, end the war, and leave Hamas in power," Netanyahu said.

"Israel cannot accept that."

"Hamas would be able to achieve its promise of carrying out again and again and again its massacres, rapes and kidnapping."

In Cairo, Hamas leaders held a second day of truce talks with Egyptian and Qatari mediators, with no apparent progress reported as the group maintained its demand that any agreement must end the war in Gaza, Palestinian officials said.

The war began after an assault by Hamas on southern Israel on Oct. 7 in which 1,200 people were killed and 252 hostages taken, according to Israeli tallies.

Israel's ensuring military offensive has killed more than 34,600 Palestinians, according to the health ministry in the Hamas-ruled Gaza. The bombardment has devastated much of the coastal enclave and caused a humanitarian crisis.