• UN condemns IDF attack on sleeping children as violation of international law • Strike on crowded market in Shujai'iya during ceasefire kills 17 • Death toll now more than 1,300 after three weeks of fighting

United Nations officials described the killing of sleeping children as a disgrace to the world and accused Israel of a serious violation of international law after a school in Gaza being used to shelter Palestinian families was shelled on Wednesday.

At least 15 people, mostly children and women, died when the school in Jabaliya refugee camp was hit by five shells during a night of relentless bombardment across Gaza. More than 100 people were injured.

Ban Ki-moon, the UN secretary general, said the attack was "outrageous and unjustifiable" and demanded "accountability and justice". The UN said its officials had repeatedly given details of the school and its refugee population to Israel.

A Palestinian girl cries while receiving treatment for her injuries caused by an Israeli strike. Photograph: Khalil Hamra/AP

Fighting in Gaza continued through the day despite a four-hour humanitarian ceasefire called by Israel from 3pm. A crowded market in Shujai'iya was hit in the late afternoon, causing at least 17 deaths, including a journalist, and injuring about 200 people, according to Gaza health officials. They said people had ventured out to shop in the belief a ceasefire was in place. Witnesses said several shells struck as people were running away. Israel said rockets and mortar shells continued to be fired from Gaza.

Israel on Thursday was showing no sign of scaling back Operation Protective Edge, with the military reportedly calling up an additional 16,000 reserves as the offensive entered its 24th day.

At the UN school the first shell came just after the early morning call to prayer, when most of those taking shelter were asleep, crammed into classrooms with what few possessions they had managed to snatch as they fled their homes.

About 3,300 people had squashed into Jabaliya Elementary A&B Girls' School since the Israeli military warned people to leave their homes and neighbourhoods or risk death under intense bombardment. Classroom number one, near the school's entrance, had become home to about 40 people, mostly women and children.

As a shell blasted through the wall, showering occupants with shrapnel and spattering blood on walls and floors, Amna Zantit, 31, scrambled to gather up her three terrified infants in a panicked bid for the relative safety of the schoolyard. "Everyone was trying to escape," she said, clutching her eight-month old baby tightly. Minutes later, a second shell slammed through the roof of the two-storey school. At least 15 people were killed and more than 100 injured. Most were women or children.

Pierre Krähenbühl, commissioner-general of the UN agency for Palestinian refugees, UNRWA, said the shelling of the school was a "serious violation of international law by Israeli forces".

Krähenbühl said: "Last night, children were killed as they slept next to their parents on the floor of a classroom in a UN-designated shelter in Gaza. Children killed in their sleep; this is an affront to all of us, a source of universal shame. Today the world stands disgraced."

Khalil al-Halabi, the UN official in charge of the schools in the area, was quickly on the scene. Bodies were littered over the classroom, and the badly injured lay in pools of blood amid the debris and rubble caused by the blast. "I was shaking," he said. "It was very, very hard for me to see the blood and hear the children crying."

By daylight, the detritus of people's lives was visible among ruins of the classroom: a ball, a bucket, some blankets, tins of food, a pair of flip-flops. The corpses of donkeys, used to haul the meagre possessions of refugees to what they thought was safety, lay at the school's entrance as two lads wearing Palestinian boy scout scarves collected human body parts for burial. Five of the injured were in a critical condition in hospital.

A Palestinian collects body parts in a classroom at the Abu Hussein UN school. Photograph: Lefteris Pitarakis/AP

Halabi was facing impossible requests for advice from those who escaped the carnage. "These people are very angry. They evacuated their homes and came here for protection, not to be killed inside a UN shelter. Now they are asking me whether to stay or leave. They are very frightened. They don't know what to do."

The attack on the school was the sixth time that UNRWA premises have been hit since the war in Gaza began more than three weeks ago, the UN said.

Palestinians fled their homes after Israel warned that failure to do so would put their lives at risk. Those at the Jabaliya school were among more than 200,000 who have sought shelter at UN premises in the belief that families would be safe.

Analysis of evidence gathered at the site by UNRWA led to an initial assessment that Israeli artillery had hit the school, causing "multiple civilian deaths and injuries including of women and children and the UNRWA guard who was trying to protect the site. These are people who were instructed to leave their homes by the Israeli army."

Krähenbühl added: "Our staff, the very people leading the humanitarian response, are being killed. Our shelters are overflowing. Tens of thousands may soon be stranded in the streets of Gaza, without food, water and shelter if attacks on these areas continue."

The Israel Defence Forces (IDF) said it was investigating the incident at the UN school. Initial inquiries showed that "Hamas militants fired mortar shells from the vicinity of the school, and [Israeli] soldiers responded by firing towards the origins of the fire", a spokeswoman said.

A UN source said there was no evidence of militant activity inside the school.

The US, which has been at odds with Israel's prime minister, Binyamin Netanyahu, over efforts to secure a ceasefire, condemned the school shelling but did not specifically blame Israel.

The incident comes after an explosion at another UN school in Beit Hanoun last week as the playground was filled with families awaiting evacuation. Israel denied responsibility for the deaths, saying a single "errant" shell fired by its forces hit the school playground, which was empty at the time.

A damaged classroom of the school. Photograph: Mohammed Saber/EPA

UNRWA has rejected the IDF's account, saying an initial shell was followed by several others within minutes. Reporters who visited the school shortly afterwards said damage and debris was consistent with mortar rounds. UNRWA has found rockets at three of its schools in Gaza in the past three weeks, which it has swiftly condemned as "flagrant violation[s] of the neutrality of our premises".

Israel says militants from Hamas and other organisations launch rockets from the vicinity of UNRWA properties.

The Israeli military said it had targeted more than 4,100 sites in Gaza since the start of the conflict on 8 July. The death toll in Gaza rose above 1,300 on Wednesday.

Three soldiers were killed in fighting around Khan Younis, bringing the total IDF death toll to 56. Three civilians have died in rocket attacks on Israel.

In an emotional statement, the Archbishop of Canterbury, Justin Welby, said the "destructive cycle of violence has caused untold suffering".

He said: "You can't look at the pictures coming from Gaza and Israel without your heart breaking. We must cry to God and beat down the doors of heaven and pray for peace and justice and security. Only a costly and open-hearted seeking of peace between Israeli and Palestinian can protect innocent people, their children and grandchildren, from ever worse violence."

He called for a renewed "commitment to political dialogue in the wider search for peace and security for both Israeli and Palestinians".

Support for the military operation among the Israeli public remained solid. A poll published by Tel Aviv university this week found 95% of Israeli Jews felt the offensive was justified. Only 4% believed too much force had been used.