The fighting erupted Friday when Hamas security men surrounded a mosque in the southern Gaza town of Rafah on the Egypt border where about 100 members of Jund Ansar Allah, or the Soldiers of the Companions of God, were holed up.
Flares lit up the sky overnight as Hamas machine gun fire and rocket propelled grenades slammed into the mosque. The militants inside the structure returned fire with automatic weapons and grenades of their own.
The head of the radical Islamic group, Abdel-Latif Moussa, was killed when fighting resumed after dawn Saturday, Ihab Ghussein, a Hamas Interior Ministry spokesman, told The Associated Press.
He said Moussa detonated an explosives vest he was wearing during the fighting.
"The so-called Moussa has committed suicide ... killing a mediator who had been sent to him to persuade him and his followers to hand themselves over to the government," Ghussein said.
He said the fighting ended later in the morning.
Dr. Moaiya Hassanain of the Palestinian Health Ministry in Gaza said a total of 22 people, including six Hamas police officers and an 11-year-old girl, were killed in the violence that also wounded 150.
The group's Web site vowed vengeance, meanwhile, saying "we swear to God to avenge the martyrs' blood and we will turn their women to widows."
Hamas also confirmed the death in the fighting of one of its high level commanders, Abu Jibril Shimali, whom Israel said orchestrated the capture three years ago of Sgt. Gilad Schalit, an Israeli soldier who is still being held by Hamas.
The fighting appeared to confirm Hamas' iron rule in Gaza despite a punishing Israeli and Egyptian-led blockade that keeps all but basic humanitarian supplies from entering the impoverished seaside territory.
It also underscored the group's determination not to allow opponents with differing ideologies to gain a foothold in Gaza. The Gaza Strip and the West Bank are together supposed to make up a future Palestinian state, but Hamas' bloody seizure of Gaza in 2007 created rival governments in the two territories
- located on opposite sides of Israel - that are complicating Palestinian efforts to gain independence.
Jund Ansar Allah claims inspiration from al-Qaida's ultraconservative brand of Islam but no direct links have been confirmed.
The confrontation was triggered when the leader of the group defied Gaza's Hamas rulers by declaring in a Friday prayer sermon that the territory was an Islamic emirate.
Jund Ansar Allah and a number of other small, shadowy radical groups seek to enforce an even stricter version of Islamic law in Gaza than that advocated by Hamas.