The Izz ad-Din al-Qassam Brigades called the Saturday night blast in Deir al-Balah 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 leader Ismail Haniyeh said Sunday after funerals for the dead militants that they "thwarted hundreds of security and intelligence operations throughout the years."
He vowed to "hit back at the enemy until we win," saying Hamas was "in an open war with the enemy."
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.
Gaza media initially reported the blast was caused by a "work accident."
A Gaza source told Ynet 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.
One of the victims was reportedly a commander of the engineering unit, which is part of the Qassam Brigades' central strip division, while another was a communications commander for the same division.