Four shells landed inside a United Nations shelter in the Gaza Strip Thursday, killing 16 refuge-seeking Palestinians, seven of them children, wounding 200 more and threatening to scramble the extensive international efforts under way to arrange a ceasefire between Israel and Hamas.

The circumstances here are confusing: The shells might have come from errant Israeli fire, or from Hamas, the militant Palestinian movement that is leading the battle against Israel. But it is Israel, the invader, which is being accused of killing civilians and committing war crimes.

UN chief Ban Ki-moon condemned the attack, saying it "underscores the imperative for the killing to stop – and to stop now."

Story continues below advertisement

The deadly shelling happened in Beit Hanoun, a community of cinder-block houses with big families, in the northeast corner of the Palestinian territory. Because of its proximity to Israel, it's been a popular place for militants to launch makeshift rockets against Israeli cities and towns. And it's often the first place Israel invades when it crosses the border to force the militants to stop. In this conflict, it appears also to be the origin of several Hamas tunnels that pass under the Israeli border.

Midafternoon Thursday, despite the hot Gaza sun, several hundred people had gathered in the open courtyard of Beit Hanoun's Elementary Co-Ed A and D school, waiting for Red Cross vehicles to take them safely away from the fierce fighting engulfing their community.

The school was a designated United Nations shelter for displaced people.

Just before 3 p.m., as shells flew fast and furious outside the school between advancing Israeli forces and Hamas militants resisting them, four "explosive projectiles" landed inside the compound. The people didn't have a chance.

"All of us sat in one place, when suddenly four shells landed on our heads," Laila al-Shinbari told Reuters. "Bodies were on the ground, [there were] blood and screams. My son is dead and all my relatives are wounded, including my other kids," she wept.

Fingers were quickly pointed at Israel as the party responsible.

Christopher Gunness, long-time spokesman for the United Nations Relief and Works Agency (UNRWA), said UNRWA had tried all day "to co-ordinate with the Israeli army a window for civilians to leave."

Story continues below advertisement

"That was never granted … and the consequences of that appear to be tragic."

Mr. Gunness told reporters that Israeli forces had bombed UN shelters on three separate occasions since Monday. One of the shelters, a school in Deir el-Balah, was hit by Israeli fire on Wednesday, wounding five people, he said.

Mr. Ban said he was "appalled" by the news of Thursday's attack.

Just the day before, he had lashed out at Gaza militants for storing rockets inside a UN school for refugees for the second time during this conflict. Such action, he said, "turned schools into potential military targets, endangering the lives of innocent children," along with UN employees and the tens of thousands of sheltering Palestinians.

Just which side fired the shells Thursday is uncertain. Between 2 p.m. and 4 p.m., there was an extensive battle in the area around the school. Mr. Gunness acknowledged that rockets fired in the direction of Israel had fallen inside Beit Hanoun. Mark Regev, spokesman for Israeli Prime Minister Benjamin Netanyahu said it could have been Hamas that fired. "It could also have been our fire," he admitted.

Late Thursday, a spokesman for the Israel Defence Forces said the army fired mortars in the area of the UNRWA school in Gaza after Israeli troops were shot at from the area of the school during the battle.

Story continues below advertisement

In 2009, during a more extensive incursion into Gaza, Israel was similarly accused of killing 40 people inside a UN school where Palestinians had taken refuge. It was a black mark for Israel, but it turned out that the Israeli shells, fired in response to militants' fire, had not landed inside the school at all, though they did kill civilians in the street outside.

The very fact of such a tragedy happening, which pushed the total number of Palestinian fatalities in this conflict to more than 750, works against Israel.

"As this campaign goes on and the civilian casualties in Gaza mount, Western public opinion is becoming more and more concerned, and less and less sympathetic to Israel," British Foreign Secretary Philip Hammond said on a visit to Israel.

Turkey's Prime Minister Recep Tayyip Erdogan said Israel should be put on trial for its actions, while Brazil recalled its ambassador from Tel Aviv in protest.

Late Wednesday, the U.S. Federal Aviation Administration lifted its ban on flights in and out of Israel, which it had imposed out of concern for the risk of planes being hit by Hamas rockets.

On Thursday, Israeli soldiers shot and killed three Palestinian protesters and wounded about 100 in confrontations with several thousand people demonstrating in the occupied West Bank against the Israeli offensive in Gaza, Palestinian medical officials said. Israel Radio reported it was the biggest anti-Israel demonstration since the 2000-05 Palestinian uprising.

Story continues below advertisement

Meanwhile, U.S. Secretary of State John Kerry, following meetings with Israeli and Palestinian leaders in Jerusalem and Ramallah, flew to Cairo Thursday to try to finalize a formula for a ceasefire acceptable to both sides in this conflict. A first attempt by Egypt last week called for both sides simply to halt hostilities and come to Cairo to discuss their differences. Israel agreed; Hamas rejected the idea.

In Qatar Thursday, Hamas political leader Khaled Meshaal said his organization was prepared to sign a truce provided Israel's siege of Gaza is lifted. Since 2007, when Hamas took control of Gaza from the Palestinian Authority of Mahmoud Abbas, Israel has restricted movement of all people and goods in and out of almost every access point. Egypt controls the other one.

"We seek full international commitment to the end of the aggression and the siege over Gaza – real commitment," Mr. Meshaal told reporters.

"We want an international airport, we want a seaport, we want an opening to the outside world, and not the situation where we are controlled by a few border crossings that turn Gaza into a huge prison, where no one can leave even for medical treatment or to work.

"When we get a clearly worded drafting that guarantees these things, and the international community gives its backing to this draft – than the fire can be stopped, even today."

Israel has rejected any kind of accommodation with Hamas. But with Thursday's school deaths perhaps tipping the balance of world opinion against them, Israelis may want to take a second look at Mr. Meshaal's terms.

Story continues below advertisement

With reports from Reuters