Israel Defense Forces tank fire killed at least 30 Palestinians at a United Nations school in the Gaza Strip on Tuesday, UN officials and medical sources and at two hospitals said.

Palestinian officials had initially said that 40 people were killed in the attack, but UN sources put the number at 30 killed and 55 wounded.

An IDF spokesman said that troops had fired mortar rounds at the school, after militants barricaded inside shot mortar shells at the Israeli forces.

"Initial checks ... show that from inside the school mortars were fired at Israeli forces," a spokesman said. "In response, the forces fired a number of mortar rounds into the area."

The army said that the bodies of numerous Hamas militants were found inside the school following the attack.

The attack brought the Palestinian death toll to nearly 600 in Israel's 11-day offensive on the Hamas-ruled coastal territory.

Two tank shells exploded outside the Gaza school, spraying shrapnel on people inside and outside the building, where hundreds of Palestinians had sought refuge from fighting between Israeli soldiers and Hamas militants. In addition to the dead, several dozen people were wounded, the officials said.

Medical officials said all the dead were either people sheltering in the school or local residents.

Also on Tuesday, Israel Air Force warplanes struck a building in Gaza in which the head of Hamas' rocket division was staying. It was not immediately clear whether Ayman Sayam was hit in the attack, which occurred in the Jabalya refugee camp in the northern Gaza Strip.

"There's nowhere safe in Gaza. Everyone here is terrorized and traumatized," said John Ging, the top UN official in Gaza, blaming the international community for allowing the violence to continue.

"I am appealing to political leaders here and in the region and the world to get their act together and stop this," he said, speaking at Gaza's largest hospital. "They are responsible for these deaths."

The Israel Defense Forces had no comment on the incident, but in the past has accused militants of using schools, mosques and residential neighborhoods to store weapons or launch attacks.

Earlier Tuesday, Palestinian medical officials reported that 10 civilians were killed when a shell fired by an Israeli ship hit their house on the Gaza shore.

Officials in Gaza said at least 20 people were killed in shelling up and down the strip on Tuesday. Only two of the dead could could be immediately confirmed as militants.

United Nations humanitarian chief John Holmes has recently put the Palestinian death toll at 500, with about 125 of them civilians, since Israel launched Operation Cast Lead against Hamas in Gaza.

Gaza health officials, however, have reported that since the offensive began on Dec. 27 more than 550 Palestinians have been killed and 2,500 wounded, including 200 civilians.

Israel's stated goals in the operation are the cessation of Palestinian cross-border rocket fire and the destruction of the Islamist militant group Hamas' infrastructure.