Abdel-Latif Moussa was surrounded by armed supporters in the mosque
At least 13 people have been killed and at least 85 injured in a fierce gun battle in Gaza, emergency services say.
Eyewitnesses say hundreds of Hamas fighters and policemen surrounded a mosque where followers of a radical Islamist cleric were holed up.
Hamas fired rocket-propelled grenades at the mosque and stormed the leader's house in Rafah, near the Egypt border.
It is thought that at least 100 supporters of the al-Qaeda-linked group, Jund Ansar Allah, were inside.
At least one Hamas fighter was killed by a grenade fired from the mosque but most of those killed were supporters of the cleric. One child was also killed.
The entire neighbourhood was sealed off as the shooting continued after dark - in what was one of the most violent incidents in the Hamas-controlled Gaza Strip since an Israeli offensive in December and January.
It was not immediately clear if the mosque's imam, Abdul-Latif Moussa, was captured during the fighting.
Earlier, during Friday prayers, hundreds of worshippers at Ibn-Taymiyah mosque declared Gaza an "Islamic emirate".
Abdul-Latif Moussa and armed supporters swore to fight to the death rather than hand over authority of the mosque to Hamas.
During his own Friday sermon, the leader of Hamas in Gaza, Ismail Haniya, dismissed Mr Moussa's comments.
"These declarations [of an Islamic emirate] are aimed towards incitement against the Gaza Strip and an attempt at recruiting an international alliance against the Gaza Strip.
"And we warn those who are behind these Israeli Zionist declarations: the Gaza Strip only contains its people."
Jund Ansar Allah (Army of the Helpers of God) gained some prominence two months ago when it staged a failed attack on a border crossing between Gaza and Israel.
The group is very critical of Hamas, which seized Gaza in 2007, accusing the Islamist group of not being Islamist enough.
Hamas has cracked down on al-Qaeda-inspired groups in the past, the BBC's Middle East correspondent Katya Adler says.
Hamas is concerned they may attract more extremist members, and has forbidden anyone except what it describes as Hamas security personnel from carrying weapons in Gaza, our correspondent says.