Gaza gunmen killed 18 alleged spies for Israel on Friday, including seven who were lined up behind a mosque with bags over their heads and shot in front of hundreds of people. The killings came in response to Israel's deadly airstrike against three top Hamas military commanders.

The killings occurred after more than six weeks of heavy fighting between Israel and Hamas. In new violence, a 4-year-old Israeli boy was killed by Palestinian rocket fire, while four Palestinians were killed in Israeli airstrikes in Gaza.

Israel's prime minister, Benjamin Netanyahu, vowed a tough response to the killing. In all, more than 2,000 Palestinians and 68 people on the Israeli side have died.

In Gaza, Hamas media said Friday's shootings signaled the start of a crackdown, under the rallying cry of "choking the necks of the collaborators." It was the largest number of suspected informers killed by Hamas in a single day since it seized Gaza by force in 2007.

Palestinian relatives grieve during the funeral for a senior commander of the Hamas military wing, Mohammed Abu Shamaleh, killed in Israeli airstrikes Thursday. (Hatem Ali/Associated Press)

The Al Majd website, which is close to the Hamas security services, said suspects would now be dealt with "in the field" rather than in the courts in order to create deterrence.

Hamas said it would not release the names of those killed because it wanted to protect the reputation of their families. The Palestinian Center for Human Rights said two of those killed Friday were women. It called for an immediate halt to what it said were "extra-judicial executions."

The killings came a day after an Israeli airstrike on a house in southern Gaza killed three senior military leaders of Hamas. The three had played a key role in expanding Hamas' military capabilities, including building a network of attack tunnels into Israel and smuggling weapons.

Earlier in the week, another strike killed the wife and two children of Mohammed Deif, the shadowy leader of the Hamas military wing. Deif's fate remains unclear.

Friday's events began with the shooting of 11 alleged informants at the Gaza City police headquarters in the morning. Of the 11, two were women, the Palestinian rights centre said.

Seven against wall

Later in the day, seven people were killed outside the city's downtown al-Omari mosque as worshippers wrapped up noon prayers. Photos from the incident posted on several Palestinian websites showed several hundred people gathered near the scene.

The photos showed masked, black-clad gunmen leading several men with bags over their heads to a wall.

Witness Ayman Sharif, 42, said a piece of paper was affixed to the wall above the head of each of the seven, with his initials and his alleged crime.

Sharif quoted one of the gunmen as saying the seven "had sold their souls to the enemy for a cheap price" and had caused killing and destruction.

The commander of the group then gave the order to the others to open fire with their automatic rifles. He said the bodies were collected by an ambulance and the gunmen left.

Network of informers

Friday's killing marked the third time since the outbreak of the Israel-Hamas war six weeks ago that Hamas announced the killing of alleged collaborators. On Thursday, Al Majd said seven people were arrested on suspicion of working with Israel and that three of them were killed.

In pinpointing the whereabouts of the Hamas commanders, Israel likely relied to some extent on local informers. Israel has maintained a network of informers despite its withdrawal from Gaza in 2005, at times using blackmail or the lure of exit permits to win co-operation.

Meanwhile, Israel-Gaza fighting continued for a third day since the collapse of Egyptian-led ceasefire talks earlier this week.

By early evening, Gaza militants had fired at least 90 rockets and mortar shells at Israel, while Israel carried out at least 30 airstrikes in Gaza, the military said.

Just before sundown, a mortar shell landed in the Israeli village of Nahal Oz near the Gaza border, killing the 4-year-old boy, rescue officials said. Police released a photo of the scene showing two charred cars destroyed in the attack.

Netanyahu's office said the prime minister expressed his condolences and vowed that Hamas would pay a "heavy price."

2,091 Palestinians killed

Elsewhere in Israel, one civilian was moderately wounded by a rocket in the southern city of Beersheba and another was lightly hurt by a rocket that landed in the border town of Sderot. In the city of Ashdod, a rocket hit a synagogue and three people were lightly hurt by shattered glass.

In Gaza, one of the strikes hit a livestock farm where two workers were killed and three people were wounded, said Gaza health official Ashraf al-Kidra. The Israeli military said its strikes targeted concealed rocket launchers and weapons sites.

Since Israel-Hamas fighting erupted on July 8, at least 2,091 Palestinians have been killed in the coastal territory, according to Gaza health official Ashraf al-Kidra.

Nearly a quarter of the dead — 469 — are children, according to a UNICEF field officer in Gaza, Pernilla Ironside. Of the more than 10,500 Palestinians wounded, nearly one-third are children, according to UNICEF figures, while some 100,000 Gazans have been left homeless.

On the Israeli side, the boy's killing Friday raised the death toll to 68 people, including 64 soldiers, three civilians and a Thai worker.

The renewed fighting dashed hopes for a lasting truce. Earlier this week, Hamas rejected an Egyptian truce proposal under which Israel would gradually ease its blockade of Gaza, without giving specific commitments.

Hamas demands a lifting of the border closure imposed by Israel and Egypt after the militant group's takeover of the coastal strip in 2007.

Nothing less

A quick resumption of indirect talks between Israel and Hamas in Cairo also seems unlikely, particularly after the killing of the three Hamas commanders. Senior Hamas political leader Ismail Haniyeh said late Thursday that his group would not budge from its demands.

"We will not accept anything less than an end to the (Israeli) aggression and an end to the blockade," Haniyeh said in a statement posted online by Hamas-run news service Al Rai. "Anyone involved in ceasefire efforts must understand that our people will not accept anything less than this."

Israel says the Gaza blockade is needed to prevent Hamas and other militant groups from getting weapons. The restrictions prevent most Gazans from travelling outside the crowded coastal strip and bar most exports.

Amid the crisis, Palestinian President Mahmoud Abbas met Hamas political chief Khaled Mashaal in Qatar to push Hamas negotiators to return to cease-fire talks, and to encourage Qatar to support Egyptian cease-fire efforts, a Palestinian official said.

Abbas flew to Egypt later Friday to meet with Egyptian intelligence officials to discuss cease-fire efforts, the official added, speaking on condition of anonymity to discuss issues related to the negotiations. Abbas is scheduled to meet with Egyptian President Abdel Fattah El-Sissi during a three-day visit to Egypt.