Fifteen Palestinians have died and more than 90 were injured after Israeli tank shells slammed into a crowded UN school sheltering Gaza war refugees, health officials and UN chiefs have said.

The Israeli military said mortar shells had been fired from near the school, and that soldiers fired back.

Later, the Israeli military declared a four-hour humanitarian ceasefire in parts of Gaza beginning at 3pm (1200GMT). Hamas had no immediate comment.

Israeli airstrikes and shelling also killed 40 Palestinians elsewhere in the coastal territory on Wednesday, including multiple members of two families struck in their homes.

The strike at the UN school in the Jebaliya refugee camp came as part of Israel's heaviest air and artillery assault in more than three weeks of Israel-Hamas fighting.

The Israeli campaign escalated on Tuesday, with airstrikes destroying key symbols of Hamas power, including the home of the top Hamas leader. Gaza's only power plant was shut down after shells set its fuel tank on fire.

On Wednesday, Israeli aircraft struck dozens of Gaza sites, including five mosques it said were being used by militants, while several other areas came under tank fire.

In Jebaliya, tank shells hit the UN school before dawn, said a spokesman for the UN Relief and Works Agency. The agency is sheltering more than 200,000 people displaced by the fighting at dozens of UN schools across the coastal strip.

Assad Sabah said he and his five children were huddling under desks in one of the classrooms because of the constant sound of tank fire throughout the night.

"We were scared to death," he said. "After 4.30am, tanks started firing more. Three explosions shook the school."

He added: "One classroom collapsed over the head of the people who were inside."

In one classroom, the front wall was blown out, leaving debris and bloodied clothing. Another strike tore a large round hole into the ceiling of a second-floor classroom. The wall of the lavatories was also damaged.

The Israeli military said it fired after its soldiers were targeted by mortars operating from the vicinity of the school.

"In response, soldiers fired toward the origins of fire. And we're still reviewing the incident," the military said in a statement.

The total number of Palestinians killed since the start of fighting July 8 has increased to 1,284. In addition, more than 7,100 Palestinians have been wounded.

Israel has lost 53 soldiers and three civilians.

Israel has said its Gaza operation is meant to stop Hamas rocket and mortar fire that has reached increasingly deeper into its territory and to destroy a sophisticated network of Hamas military tunnels used for attacks in Israel.

Gaza militants have fired more than 2,600 rockets toward Israel over the past three weeks, according to the Israeli army.

The Israeli military has said it is hitting targets linked to militants, such as rocket launching sites, weapon depots and Hamas military tunnels. Over the past 23 days, Israeli forces have hit 4,100 targets in Gaza, about one-third connected to the militants' ability to launch rockets at Israel, a statement said.

The military has not provided details on strikes in which multiple members of one family were killed. There have been several dozen such strikes, according to the Palestinian human rights group Al- Mezan.