Hamas-led masked gunmen brought the suspected informants for Israel before a crowd of onlookers on Friday.
The masked men killed at least 18 of them by firing squad, delivering the message that anyone found conspiring with Israel could expect the ultimate punishment.
"They are spies. They helped kill people. The Jews did not know there was resistance here until these collaborators told them. We should clean our area of these people before we cleanse it of the Jews."
The executions came just a day after an Israeli airstrike killed three senior Hamas commanders.
Since the collapse of Egyptian-led cease-fire talks earlier this week, fighting continued for a third day.
Israel has launched about 20 airstrikes at Gaza killing at least four people.
Gaza militants responded by firing rockets killing a four-year old Israeli boy.
The boy was the first Israeli child killed by Palestinian fire since July 8th when the conflict started.
The almost two-month long war has already killed over 2-thousand Palestinians, with children taking up nearly a quarter of the dead, while around 70 have died on the Israeli side.
Hwang Ji-hye, Arirang News.