Gaza media reported the explosion was a "work accident," meaning the terrorists were killed when explosives they were dealing with went off.
While Palestinians searched the area for survivors, Hamas's military wing blamed Israel for the blast, calling the incident in a statement a "deplorable Zionist crime" perpetrated against its fighters.
"During a complicated security and intelligence operation conducted by Qassam Brigades to investigate a serious and a grave security incident conducted by the Zionist enemy against Palestinian resistance, a deplorable crime took place against our Mujahideen in the area of Zawayda in central Gaza Strip," it said.
Hamas provided no further details.
One of the victims of the explosion, as per Palestinian reports, was a commander of an engineering unit in the central strip division, while another was a communications commander for the same division.
A Gaza source told Ynet, meanwhile, that the casualties were members of an engineering group that attempted to dismantle an Israeli rocket that had not detonated. As they were working to defuse it, it went off, he added.
The blast rocked Gaza near 7:30pm, with Reuters television capturing a pillar of smoke rising above the village of Zawayda near the coast of Gaza, far from the border with Israel where tensions have escalated in recent weeks.
Denying any culpability for the explosion and consequent deaths, "The IDF is not involved in this incident in any way," a military spokesman said.
Reuters contributed to this report.