Editor’s note: This video contains graphic content. Gunmen paraded alleged spies through some of Gaza's busiest public squares, shooting them dead in a bloody warning to locals about the cost of collaborating with Israel. (Reuters)

One day after three top Hamas commanders were killed in an Israeli airstrike, at least 18 Palestinians were executed Friday by firing squads in Gaza City, sentenced to death by a “resistance court” for collaborating with Israel during a time of war.

Hours later, a barrage of mortar fire by Palestinian militants landed at an Israeli kibbutz near the Gaza border, killing a 4-year-old boy.

Daniel Tregerman was the first Israeli child killed in six weeks of fighting between Hamas and Israel. At last count, 469 children have been killed in Gaza by Israeli bombardment during the six-week war, according to UNICEF.

Israel’s Magen David Adom first aid organization said the boy was killed when a mortar shell hit a group of cars parked near his home. Shrapnel penetrated the child’s room and mortally wounded him.

Prime Minister Benjamin Netanyahu warned afterward, “Hamas will pay a heavy price for this terrible terrorist attack.”

Israeli forces carried out airstrikes on 20 different locations across the Gaza Strip, reducing a mosque and several homes to rubble and killing five people. (Reuters)

A group calling itself the Palestinian Resistance announced on Hamas-affiliated Web sites that 11 alleged collaborators — nine men and two women — were executed by firing squad Friday morning in the courtyard of an abandoned police headquarters.

Witnesses said seven more men were placed against walls with bags over their heads and shot by men in black Hamas uniforms in front of the Al-Umari mosque, according to local news media reports.

Neither Hamas nor the Palestinian Resistance named the alleged collaborators or offered details of the charges against them. They said they were withholding the names to spare their families shame.

The Palestinian Maan news agency reported that some of the bodies were later dumped at al-Azhar University and the Shifa hospital.

Palestinian militants said the informers were found guilty by local courts, supported by religious clerics, of providing information to Israel that led to the destruction of “resistance houses,” as well as revealing the location of tunnels and rocket launchers.

The executions came a day after Israeli aircraft targeted and killed three senior Hamas commanders who had gathered in a building in Rafah in south Gaza.

The targeted killings were celebrated as a major success in Israel and taken as a punishing blow in Gaza, where the Hamas commanders were well known.

Two days earlier, Israel targeted a house where it believed Mohammed Deif, the top commander of the Hamas military wing, was staying. The Israeli bombardment killed Deif’s wife and two of his children. It is still unclear whether Deif survived the strike.

“Hamas is in a panic that their organization has been penetrated by Israeli intelligence, and they are trying to find who is helping Israel to target their leaders,” said Shaul Shay, former deputy head of the Israeli National Security Council.

Shay said the executions are not meant to send a message to Israel. “It is mainly to create a kind of internal terror among the Palestinians and for Hamas to display its power over its own population,” he said. “It is not new; it has happened many times in the past. It is a kind of reflection of weakness of Hamas in these days.”

Both the phenomenon of collaboration with the Israelis and the harsh punishment meted out have a long, bloody history among Palestinians, who live under military occupation in the West Bank and under a partial trade and travel blockade in Gaza.

In the two previous wars between Hamas and Israel, Palestinian militants have executed alleged informers. In the current conflict, there were reports of suspected collaborators killed in the early weeks of the fighting but nothing as public as Friday’s executions.

“Collaboration is a much reviled phenomenon in the Palestinian community, viewed as an act of treason committed by people considered ‘scum of the Earth,’ ” said George Giacaman, founder of the program in democracy and human rights at Birzeit University in Ramallah.

Giacaman said he assumed that Hamas carried out the executions as “an object lesson to others.”

He said that if the alleged informers did, in fact, have anything to do with the targeted killings of three top Hamas commanders, “then Israel most likely decided it was worth it to sacrifice them, to blow their cover, so to speak.”

Boaz Ganor, executive director of the Institute for Counter-Terrorism at the Interdisciplinary Center in Herzliya, said, “No doubt that these two strikes by Israel were the outcome of some very accurate, up-to-date and unique intelligence. It is more than clear that there is a leak in Hamas.”

Ganor said executions of alleged collaborators are common after successful Israeli attacks against high-value targets.

In their statements, the militants urged other Palestinians who were guilty of collaboration to come forward and they would be shown mercy.

Collaboration with Israel is punishable by death under Palestinian law, but the sentence requires Palestinian Authority President Mahmoud Abbas’s approval, which was neither sought nor granted for Friday’s executions.

The Palestinian Center for Human Rights in Gaza City called upon the Palestinian Authority and resistance groups “to intervene to stop such extra-judicial executions whatever their reasons or motives are.”