The Israeli army says 21 soldiers have been killed in central Gaza - the deadliest day for its forces since the war began.

It said the soldiers were preparing explosives to demolish two buildings on Monday when a rocket-propelled grenade was fired at a nearby tank, setting off the explosion prematurely and causing the buildings to collapse on them.

Middle East latest: Underground Houthi site hit in fresh UK-US airstrikes

"We are still studying and investigating the details of the event and the reasons for the explosion," Israeli military spokesman Rear Admiral Daniel Hagari told reporters.

Israeli Prime Minister Benjamin Netanyahu said Israel would not end the fighting until Hamas had been wiped out.

He said the army would fight on until "absolute victory" was achieved.

Earlier, the military said three soldiers were killed in a separate attack in southern Gaza.

The assault came as Israeli forces pushed deep into western Khan Younis in Gaza, with an air, sea and land bombardment that included storming a hospital and arresting medical staff, Gaza health ministry spokesman Ashraf al Qidra told Reuters news agency.

The 24 fatalities means it was the deadliest day for the Israeli Defence Force in Gaza since the war started in October.