The dead and injured - including nine children, four women and six men - were sleeping when the first shell hit at around 6am local time. Many of the victims were taken to hospital in their pyjamas.

In response to the attack, Hamas called for attacks on the US. “America is offering political, financial and logistic cover for the Zionist occupation crimes, and it is responsible for the Beit Hanoun massacre. Therefore, the people and the nation all over the globe are required to teach the American enemy tough lessons,” the Islamist group said in a statement sent to the Associated Press.

Israeli army sources said that the army fired a volley of artillery shells at the northern Gaza Strip which missed their target, probably because of a human or technical error. Officially the army said it was still investigating the incident.

Witnesses said that the first shell hit a home, causing deaths and injuries. Residents took shelter while rescuers attempted to retrieve the bodies and care for the wounded. Many residents were sheltering in a nearby alleyway when a second shell landed, causing most of the casualties. A further five or six shells landed in the same vicinity over a period of 15 minutes, witnesses said.

Most of the victims belonged to the Athamna family who lived in several adjacent homes. Majid Athamna, 55, said he was sleeping when the first shell landed. “Some people were killed and injured. We went downstairs and the second shell hit while we were taking out the bodies. Then more shells came. I saw bodies cut into pieces. There were children and women. God knows why they hit this house.”

At Kamel Adwan hospital in nearby Beit Lahiya, Yazan Athamna, 15, was being treated for shrapnel injuries to his stomach and legs. He said that his mother and two grandmothers were killed as they slept. “I got out of the house and was running in the street. Then people came to help and the shelling started again,” he said.

Muhammed Odwan, 21, was lying on his stomach with shrapnel injuries to his back. “I was in the house sleeping. The shelling started and I got out of my house. All my neighbours were screaming for help and then it started it again as people gathered. My father was killed in the alleyway where we stood. Why did they do this? They want to destroy our houses and force us into exile.”

The killings follow Israel’s withdrawal from Beit Hanoun after a one-week occupation which resulted in the deaths of 52 Palestinians. During the operation, Israeli soldiers visited the houses that were hit, searched them and questioned the residents. The operation was aimed at preventing the firing of missiles at Israel, but rocket attacks have continued.

Beit Hanoun is on the border with Israel and is overlooked by Israeli tanks and artillery batteries.

Israel has fired tens of thousands of shells into Gaza in the last year, killing dozens of civilians. In June a family of seven and another man died when a shell landed on a beach in northern Gaza.

Palestinian politicians reacted with fury to the most recent attack. Atef Odwan, the Hamas minister of refugee affairs, visited the scene of the shelling, where there were deep pools of blood. “We cannot accept this destruction,” he said. “We cannot accept the peace process or talk about stopping resistance. They are trying to break the Palestinian people and its resistance and trying to force us out of our homes. But we have nothing to lose. We have no choice but to stand for our rights.”

The president, Mahmoud Abbas, ordered three days of mourning throughout the Palestinian territories. “This is a horrible, ugly massacre committed by the occupation against our children, our women and elderly in Beit Hanoun,” he said in a statement. “We urge and call the security council to convene immediately to stop the massacres committed against our people and to uphold their responsibility to stop these massacres.”

Ismail Haniyeh, the prime minister, said that negotiations on a unity government between Fatah and Hamas would be suspended in protest at the attack. Ghazi Hamad, a government spokesman, told AP: “After this barbaric operation, Israel proved that it’s not a humane state. It’s a state that believes in killing, and therefore this state should cease to exist.”

Israeli leaders showed little remorse for the deaths, stating that the army did not intend to kill civilians. Tzipi Livni, the Israeli foreign minister, described the incident as “regrettable” while Miri Eisin, a spokeswoman for Ehud Olmert, the prime minister, said that Israeli operations would continue as long as missiles were fired over the border, weapons were smuggled into Gaza and Hamas continued to provoke Israel.

The killings provoked protests in Gaza and the West Bank. Shots were fired at the empty EU offices in Gaza City and demonstrators called for revenge against Israel. At the Kamal Adwan hospital, Nizar Rayan, a local Hamas leader, said: “We are going to fight against the so-called Israel. We are going to launch our rockets, our martyrs are going to sacrifice their lives in the depths of our occupied land. They will strike in Jaffa, in Haifa, inside Ashdod. The battle will continue. The rifle is not going to be set down. All of us are martyrs in waiting. Revenge is coming.”

The Islamic Jihad militant group also called for revenge. “Martyrdom is coming. The response will not take long, because the time is ready for punishment, and the time is ready for revenge,” it said in a statement.

In the hours after the attack militants fired eight rockets at Israel from Gaza. Most of the rockets landed in open land but two landed in the centre of the town of Sderot, causing one minor injury.