By Ben Hubbard and Jodi Rudoren

New York Times News Service

BEIT HANOUN, Gaza Strip — For more than a week, as the war engulfed their homes, families in this northern Gaza town packed up their belongings and children and headed to the one place they presumed would remain safe: the United Nations school.

But in the last few days, the war approached there as well. The Israeli military warned Monday that the shelter should be evacuated. By Thursday, the U.N. had decided to withdraw its staff and to stop providing food.

Then, as the Palestinians gathered in the courtyard Thursday, believing they were about to be bussed elsewhere, blasts tore through the crowd, killing 16 people and sending scores of wounded, mostly women and children, streaming into local hospitals.

The source of the blasts remained unclear, setting off recriminations between Israelis and Palestinians over which side was responsible. People in the school reported from three to five blasts and accused Israel of shelling them. Israel suggested that rockets fired by militants might have fallen short of their targets or that the school may have been hit with errant shells from either side in fighting nearby. The U.N. said it could not confirm the source of the blasts.

The shelling came on the 17th day of an increasingly bloody conflict between Israel and Palestinian militants that has killed nearly 800 people in Gaza. On the Israeli side, 32 soldiers and three civilians have been killed.

This was the fourth time that U.N. schools had been struck.

The blasts in Beit Hanoun highlighted the desperate search by Gaza civilians to find refuge. It also came as Secretary of State John Kerry was pushing intensively to achieve a cease-fire. One proposal under discussion, according to an official involved, was for a seven-day pause that could begin Sunday.

“We went to the school to be safe,” said Mohammed Shinbary, kneeling on the floor of a hospital and cradling his wounded 7-year-old daughter, Aya. “And then they hit the school.”

Ban Ki-moon, the U.N. secretary-general, who was in the region this week to try to advance cease-fire efforts and met with Kerry, said in a statement that he was “appalled” by the school attack.

“Many have been killed — including women and children, as well as U.N. staff,” he said, adding that staff members had been trying throughout the day to arrange a pause in the hostilities so that civilians could be evacuated.