The bloodshed came on the heels of an escalation by both sides fighting in the embattled coastal territory, further dimming prospects for a sustainable cease-fire despite international diplomatic efforts.
The attack on the U.N. school in the Jebaliya refugee camp was the second deadly strike on a U.N. compound in a week. Tank shells slammed into the compound before dawn, said Adnan Abu Hasna, a spokesman for the U.N. Relief and Works Agency, UNRWA, which is sheltering more than 200,000 people displaced by the fighting at dozens of U.N. schools across Gaza.
Gaza health ministry official Ashraf al-Kidra said at least 17 people were killed and about 90 wounded in the school strike. Four of the dead were killed just outside the school compound, two in their home nearby and two in the street, after returning from pre-dawn prayers, their relatives said.
The Israeli military said it fired back after its soldiers were targeted by mortar rounds launched from the vicinity of the school.
The mortar shells were fired from a distance of some 200 meters (yards) from the school, said an Israeli military official, speaking on condition of anonymity because he was not authorized to talk to the media.
Yomtov Tamir, a retired Israeli general, said he was not familiar with Wednesday's strike but said that even though tank fire is generally "very accurate" it can miss its target for a variety of reasons.
"One - it might have gone through a target. Two - it might be a mistake in identification, that they intended to hit something specific but that it was actually something other than what the person aiming intended," he said. "There are lots of questions when terrorists are purposely shooting from civilian areas and schools. Nobody intends to fire at civilians, or shoot at schools unless they are shooting from there."
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:30 a.m., tanks started firing more. Three explosions shook the school."
"One classroom collapsed over the head of the people who were inside," he said.
In one classroom, the front wall was blown out, leaving debris and bloodied clothing. Another strike tore a large round hole in the ceiling of a second-floor classroom.
About two hours after the strike, hundreds of people still crowded the school courtyard, some dazed, others wailing.
"Where will we go?" asked Aishe Abu Darabeh, 56. "Where will we go next? We fled and they (the Israelis) are following us."
The U.N. said it was the sixth school to be hit since the conflict began on July 8, and the second to cause deaths. At least 15 civilians also were killed last Thursday when the courtyard of a U.N. school in Gaza City was hit. Israel has acknowledged that troops fired a mortar shell that hit the courtyard but said aerial footage shows the yard was empty at the time and that the shell could not have killed anyone.
"I reached levels of anger and indignation about the fact that despite all the efforts that we have put in, to ensure that places like these would be respected, that people in them would be protected when they were there - that this was not the case is intolerable," said Pierre Kraehenbuehl, the UNRWA commissioner general.
The White House also condemned the deadly shelling. White House spokeswoman Bernadette Meehan also said the U.S. is "extremely concerned" that thousands of Palestinians aren't safe in U.N.-designated shelters, despite being told by Israel's military to leave their homes. Israel has been warning civilians by phone and leaflet to leave dangerous areas ahead of strikes on militant targets.
Hours later, an Israeli airstrike hit a crowded shopping area in the Shijaiyah district in Gaza City, killing at least 16 people, including local Palestinian photographer Rami Rayan, who was wearing a press vest at the time, and wounding more than 200 people, Gaza health officials said.
Al-Kidra and witnesses said the shopping area was busy because residents, and many who had taken shelter in the area from fighting elsewhere, thought a cease-fire was in place. The Palestinian Red Crescent confirmed the death toll.
The Israeli military had no immediate comment on the strike on the shopping area, saying it was investigating the report.
Israel had earlier announced a "humanitarian window" in certain parts of the territory. But it said it would not halt fire in other areas, including in Shijaiyah, where the strike took place. Hamas spokesman Sami Abu Zuhri dismissed the cease-fire, saying it lacked any "value" because it excluded border areas from where Hamas wanted to evacuate the wounded.
"People were in the street and in the market, mostly women and kids. Suddenly more than 10 shells landed in the area, the market, in the Turkman area, and next to the gas station," said Salim Qadoum, 26, who witnessed the strike.
"The area now is like a blood bath, everyone is wounded or killed. People lost their limbs and were screaming for help. It's a massacre. I vomited when I saw what happened."
Blood stained the streets near the strike and limbs were strewn across the floor. Some survivors were yelling in shock. Scores of wounded were brought to Gaza City's Shifa Hospital where the emergency room quickly overflowed. Some of the wounded were treated on the blood-smeared floor.
An earlier airstrike also hit a warehouse in the Shijaiyah district, which has been frequently targeted by Israel. That caused a fire and sent a large cloud of black smoke billowing into the sky as firefighters and ambulances arrived at the scene.
In all, 108 Palestinians were killed by airstrikes and tank shelling in different areas of Gaza on Wednesday, raising the Palestinian casualty toll to 1,350 killed and 7,100 wounded since the July 8 start of fighting, al-Kidra said.
The number of Israeli dead also increased on Wednesday as the military said three soldiers were killed when a booby-trapped house collapsed after they identified an entrance to a tunnel inside. More than a dozen soldiers were wounded in heavy fighting Wednesday, it said.
Brig. Gen. Mickey Adelstein, a senior military official, said the structure was a clinic operated by the U.N. but the U.N. said it could not confirm that.
Gaza militants also fired 84 rockets at Israel Wednesday, including more than 26 after the cease-fire was announced, the military said.
Israel says 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 tunnels used for attacks inside Israel. Hamas has steadfastly refused efforts to forge a truce, insisting its demands including the lifting of an Israeli and Egyptian blockade must be met first.
The Israeli military says it has lost 56 soldiers since a ground war began earlier this month. Three civilians also have been killed on the Israeli side.
Maj. Gen. Sami Turgeman, the head of the army's southern command, said Israel was "a few days" away from destroying the 32 tunnels it has located so far. More than two-thirds of those have been demolished, according to Adelstein, the senior military official.
"Hamas could have built two hospitals, 20 schools, 20 clinics and 100 kindergartens with the amount of cement they used to build the tunnels," Turgeman said.
Gaza militants have fired more than 2,600 rockets toward Israel over the past three weeks, according to the Israeli army. Over the past 23 days, Israeli forces have hit 4,100 targets in Gaza, about one-third connected to rocket launching, a statement said.
Enav reported from Jerusalem. Associated Press writers Ibrahim Barzak in Gaza City, Yousur Alhlou in Jerusalem and Ariel David from southern Israel contributed to this report.