Gaza's civil defence agency said an Israeli strike on a school-turned-shelter killed at least 12 people on Tuesday, while the Israeli military said it struck a Hamas command centre.
"Our crews retrieved 12 martyrs from the Mustafa Hafiz school, which was bombed by the Israeli occupation west of Gaza City," agency spokesman Mahmud Bassal told AFP.
Thousands of displaced Palestinians had sought refuge in the school, he said, amid the ongoing Israel-Hamas war in the Gaza Strip.
The Israeli military said the school was targeted because it housed a command-and-control centre.
"Hamas terrorists used the command-and-control centre to plan and execute attacks against IDF (Israeli army) troops and the State of Israel," the military said in a statement.
It said it carried out a "precise strike on terrorists who were operating" inside the school.
Bassal had earlier given a toll of seven dead and 15 wounded in the strike, which he said had hit the second floor of the school building.
The latest death toll figure could not be independently verified.
AFP photos showed the school reduced to rubble, with scores of Palestinian men and women, many holding children, fleeing the site after the strike.
In recent weeks, the Israeli military has struck several schools across Gaza, primarily in Gaza City, accusing them of housing Hamas command centres, which the Islamist group denies.
Earlier this month, the military had struck the Al-Tabieen School in Gaza City, which according to the civil defence agency killed 93 Palestinians, while the military said 31 militants died.
Tens of thousands of displaced people have taken refuge in schools since the Israel-Hamas war broke out on October 7 after Palestinian militants attacked southern Israel.
That attack resulted in the deaths of 1,199 people, mostly civilians, according to an AFP tally based on Israeli official figures.
Militants also seized 251 people, 105 of whom are still held captive in Gaza, including 34 the military says are dead.
Israel's retaliatory military offensive against Hamas has killed at least 40,173 people in Gaza, according to the Hamas-run territory's health ministry, which does not give a breakdown of civilian and militant deaths.
Most of the dead in Gaza are women and children, according to the UN human rights office.