Israeli forces clash with Palestinian protesters outside a major mosque in Jerusalem, continuing nearly three weeks of bloody conflict that has left more than 800 people dead. (Reuters)

Israeli forces clash with Palestinian protesters outside a major mosque in Jerusalem, continuing nearly three weeks of bloody conflict that has left more than 800 people dead. (Reuters)

It was one of the worst scenes so far in a war that has put civilians in the cross hairs. An elementary school packed with hundreds of Palestinian evacuees seeking shelter under U.N. protection came under heavy fire Thursday, leaving 16 people dead and more than 100 wounded, including women, children and infants.

The question now is who did it.

A senior Israeli military spokesman, Lt. Col. Peter Lerner, said Thursday night that “there was a possibility” shells from Israeli forces­ struck the U.N.-run school in the Gaza Strip. But he also suggested that Hamas mortars or rockets could have been responsible. The Israeli army was investigating the incident “to see what exactly caused the deaths and injuries,” he said.

The bombing of the shelter was followed by more mayhem at a massive demonstration Thursday night, when thousands of Palestinians protesting the Israeli incursion in Gaza clashed with Israeli security forces at the Qalandia border checkpoint between Israel and the West Bank. At least two Palestinians were killed and scores were injured, protest leaders said.

It was one of the largest protests in the West Bank in recent years, underscoring mounting Palestinian anger at Israel and the growing civilian casualties in the two-week-old Gaza conflict. As the Muslim holy month of Ramadan comes to an end and the conflict rages on, Israeli security officials are concerned that the West Bank and mostly Arab East Jerusalem could become arenas of violent protest

“This is the West Bank waking up and saying, ‘Gaza is not alone,’ ” Lina Ali, one of the protest’s organizers, said in a phone interview. Ambulance sirens could be heard in the background. “We stand by Gaza.”

As protesters attempted to march from the West Bank city of Ramallah to Jerusalem, Israeli forces­ fired live rounds, rubber bullets and tear gas into the crowds, according to protest organizers.

Early Friday, an Israeli military spokesman said as many as 10,000 protesters “were rioting violently.” They hurled “burning tires, molotov cocktails, rocks and even fireworks” at soldiers and border police. After riot-dispersal measures failed, the spokesman said, the soldiers fired live rounds into the crowds, killing at least one protester. The spokesman said the military was looking into the report of a second death.

If the Israelis turn out to have fired the deadly salvo on the school in Gaza, international condemnation is likely to be heaped on the Jewish state, already under pressure from the Obama administration to end its 17-day offensive against Hamas, the militant Islamist movement that controls Gaza.

If it turns out Hamas is responsible for killing its own people with errant rocket or mortar fire, as Israel initially suggested Thursday, then the group — already branded a terrorist organization by Israel, the United States and the European Union — could find itself even more isolated.

Series of explosions

Witnesses, still shaking from the experience, said the shelter was filled with families who had fled their homes to escape more than two weeks of heavy shelling in the northern Gaza Strip.

As fighting raged around them Thursday morning, a series of explosions first struck the courtyard and then the school, which is run by the U.N. Relief and Works Agency, known as UNRWA.

1 of 59 Full Screen Autoplay Close July 27, 2014 Sunday July 26, 2014 July 25, 2014 July 24, 2014 Skip Ad × Shells hit U.N.-run school sheltering evacuees in Gaza Strip View Photos The school in the northern part of the Gaza Strip came under shelling on Thursday, leaving at least 15 people dead and more than 100 wounded. Caption Explosions rocked a major hospital in Gaza, causing numerous casualties, witnesses reported, on the first day of the Muslim Eid al-Fitr holiday. July 28, 2014 Families mourn and bury their child after rocket attacks on Eid al-Fitr, the holiday marking the Muslim holy month of Ramadan, killed at least 10 people. Max Becherer/Polaris Images for The Washington Post Buy Photo Wait 1 second to continue.

U.N. Secretary General Ban Ki-Moon called the attack appalling and strongly condemned it. Hamas spokesman Fauzi Barhum called the attack a “war crime” and said it showed that even U.N. shelters “are not immune to Israeli aggression.”

The latest violence raised the Palestinian death toll since the Israeli offensive began to more than 777, according to Gaza health officials. On the Israeli side, 32 Israeli soldiers, two Israeli civilians and a Thai guest worker have been killed.

Soon after the attack, the school in Beit Hanoun was empty, with blood smeared in the corridors and courtyard. There were sheep running through the corridors, spilled food, abandoned shoes and soiled bandages amid overturned desks and story books.

Survivors said they had been told to gather at noon to await buses to take them to another UNRWA school that would be safer­. “We were waiting in the courtyard; the buses never came,” said Sabah Kafarah, 17. “Then the bombs fell.” She counted three. She spoke as she cradled her infant nephew in her arms. The boy’s mother was in surgery.

All day Thursday, Beit Hanoun was a site of fierce fighting between Israeli troops and Hamas militants.

On the road from Gaza City to Beit Hanoun, large buildings were being consumed by raging fires as rockets from Hamas whistled overhead and Israeli tanks pounded targets.

The Israel Defense Forces (IDF) released a statement Thursday evening that helped explain why its forces might have hit the UNRWA shelter.

“From initial inquiries done about the incident, during the intense fighting in the area, militants opened fire at IDF soldiers from the school area,” the statement read. “In order to eliminate the threat posed to their lives, they responded with fire toward the origins of the shooting.”

At the nearby Beit Hanoun Hospital, less than a three-minute drive from the U.N. shelter, crying children were clinging to their mothers as ambulance drivers surged to the door of the emergency room.

The hospital director, Ayman Hamdan, said four patients among the first wave of arrivals died on his operating tables. He described massive injuries from shrapnel. Wounded people were missing limbs, he said.

Failed coordination efforts

Christopher Gunness, a spokesman for UNRWA, said his agency “over the course of the day” had tried to coordinate with the Israeli army a window for civilians to leave, but “it was never granted.”

“Hamas prevented civilians from evacuating the area during the window that the IDF gave them,” the Israeli military countered.

More than 140,000 Palestinians — more than 7 percent of Gaza’s total population — have fled their homes because of the fighting, and many of them have sought refuge in buildings run by UNRWA.

Thursday’s attack marked fourth time that a U.N. facility has been hit since Israel began an operation in Gaza on July 8 in a bid to stop rocket attacks on Israeli soil from the coastal enclave. Two UNRWA schools have been used by Gaza militants to hide weapons and rockets, unbeknownst to the agency, officials with the agency said.

Israeli military analysts said that mortar shells, rather than rockets or missiles, probably caused the large number of deaths and injuries at the school.

Both Israel and Hamas have deployed mortars in the conflict. Hamas mortars fired into Israel have killed a Thai worker and one of Israel’s two civilian casualties.

If some of the militants’ mortars aimed at Israel fell short, as Israel has suggested, they could have had “devastating” impact on the ground, said Miri Eisen, a retired Israeli military colonel and former military intelligence officer.

Secretary of State John F. Kerry did not cast blame for the attack on the school, which complicates his efforts to secure even a temporary truce.

“The tragic incident today, and every day, just underscores the work we are trying to do and what we are trying to achieve,” Kerry told reporters in Cairo, where he was pursuing a cease-fire. ”

U.S., U.N., Egyptian and other diplomats are proposing a temporary cease-fire to begin as soon as this weekend and to last a week, officials familiar with the effort said Thursday.

An official who participated in the hurried effort spoke on the condition of anonymity to discuss the sensitive diplomatic effort. The arrangement would apparently leave Israeli ground forces in place for now, and it was not clear that Hamas would agree.

The temporary truce could be a bridge to a long-term deal.

Raghavan reported from Jerusalem. Anne Gearan in Cairo contributed to this report.