"Five martyrs were killed in a resistance activity in Saghira neighborhood" in eastern Gaza City, the local Hamas information office said, without elaborating. Later a Hamas official confirmed six men had been killed.
A security source told AFP the "accidental explosion" happened "inside of an Al-Qassam Brigades tunnel, which collapsed on some 12 members."
Eyewitnesses reported a large explosion near the border with Israel, but the IDF told AFP they had no knowledge of the incident.
Hamas, which ruled the Gaza Strip since June 2007, formally relinquished power over it on June 2, when Palestinian president Mahmud Abbas appointed a government of independents under a unity agreement.
But Hamas security forces remain in place in Gaza, and the Brigades were not disarmed, as the deal does not relate to the military factions of Palestinian movements.
In addition to tunnels dug under the Egyptian border to smuggle goods, militant Gaza groups use tunnels to infiltrate beyond Israel's lines.