Hamas fighters masks and dressed in black gunned down seven of those spies, whose faces were covered and hands bound, in front of worshippers emerging from the Omari mosque on Palestine Square, in the first public executions in the enclave since the 1990s.
A further 11 were killed at an abandoned police station near Gaza City, Hamas security officials said.
"The resistance has begun an operation called 'strangling the necks', targeting collaborators who aid the (Israeli) occupation, kill our people and destroy houses," said Al-Majd, a website run by Hamas's internal security service.
A so-called conviction letter signed by the "Palestinian Resistance" was posted on a wall near where the bodies of the alleged collaborators lay.
The notice read: "They provided the enemy with information about the whereabouts of fighters, tunnels of resistance, bombs, houses of fighters and places of rockets, and the occupation bombarded these areas, killing a number of fighters.”
NJF/NJF