CAIRO/JERUSALEM (Reuters) - Israel targeted a Gaza school on Thursday that it said contained an Hamas compound, killing fighters involved in the Oct. 7 attack that sparked the eight-month war, but Gaza media said the strike killed at least 27 people seeking shelter.

Ismail Al-Thawabta, the director of the Hamas-run government media office, rejected Israel's claims that the U.N. school in Nuseirat, in central Gaza, had hidden a Hamas command post.

"The occupation uses lying to the public opinion through false fabricated stories to justify the brutal crime it conducted against dozens of displaced people," Thawabta told Reuters.

Israel's military said that before the strike by Israeli fighter jets, the military took steps to reduce the risk of harm to civilians.

Israel has said there will be no halt to fighting during ceasefire talks.

In an apparent blow to a truce proposal touted last week by U.S. President Joe Biden, the leader of Hamas on Wednesday said the group would demand a permanent end to the war in Gaza and Israeli withdrawal as part of a ceasefire plan.

The remarks by Hamas leader Ismail Haniyeh appeared to deliver the Palestinian militant group's reply to the proposal that Biden unveiled last week. Washington had said it was waiting to hear an answer from Hamas to what Biden described as an Israeli initiative.

"The movement and factions of the resistance will deal seriously and positively with any agreement that is based on a comprehensive ending of the aggression and the complete withdrawal and prisoners swap," Haniyeh said.

Asked whether Haniyeh's remarks amounted to the group's reply to Biden, a senior Hamas official replied to a text message from Reuters with a "thumbs up" emoji.

Washington is still pressing hard to reach an agreement. CIA director William Burns met senior officials from mediators Qatar and Egypt on Wednesday in Doha to discuss the ceasefire proposal.

Since a brief week-long truce in November, all attempts to arrange a ceasefire have failed, with Hamas insisting on its demand for a permanent end to the conflict, while Israel says it is prepared to discuss only temporary pauses until the militant group is defeated.

Biden has repeatedly declared that ceasefires were close over the past several months, only for no truce to materialise.

Last week's announcement came with far greater fanfare from the White House, and at a time when Israeli Prime Minister Benjamin Netanyahu is under mounting domestic political pressure to chart a path to end the eight-month-old war and negotiate the release of Israeli hostages held by Hamas.

Hamas, which rules Gaza, precipitated the war by attacking Israeli territory on Oct. 7, killing around 1,200 people and capturing more than 250 hostages, according to Israeli tallies. Around half of the hostages were freed in the war's only truce so far, which lasted a week in November.

Israel's military assault on Gaza has killed more than 36,000 people, according to health officials in the territory, who say thousands more dead are feared buried under the rubble.

ISRAEL LUKEWARM

Although Biden described the ceasefire proposal as an Israeli offer, Israel's government has been lukewarm in public. A top Netanyahu aide confirmed on Sunday Israel had made the proposal even though it was "not a good deal".

Far-right members of Netanyahu's government have pledged to quit if he agrees to a peace deal that leaves Hamas in place, a move that could force a new election and end the political career of Israel's longest-serving leader.

Centrist opponents who joined Netanyahu's war cabinet in a show of unity at the outset of the conflict have also threatened to quit, saying his government has no plan.

Meanwhile, Defence Minister Yoav Gallant said there would be no let-up in Israel's offensive while negotiations over the ceasefire proposal were under way.

"Any negotiations with Hamas would be conducted only under fire," Gallant said in remarks carried by Israeli media after he flew aboard a warplane to inspect the Gaza front.

Israel announced a new operation against Hamas in central Gaza on Wednesday, where Palestinian medics said airstrikes had killed dozens of people.

The armed wings of Hamas and Islamic Jihad said they had fought gun battles with Israeli forces on Wednesday in areas throughout the enclave and fired anti-tank rockets and shells.

Two children were among the dead laid out on Wednesday in the city's Al Aqsa Martyrs Hospital, one of the last hospitals functioning in Gaza. Mourners said the children had been killed along with their mother, who had been unable to leave when others in the neighbourhood did.

"This is not war, it is destruction that words are unable to express," said their father Abu Mohammed Abu Saif.

(Reporting by Reuters bureaux; Writing by Michael Perry; Editing by Gerry Doyle)

By Nidal al-Mughrabi and James Mackenzie