RAFAH, Gaza Strip — Faced with eroding popular support and disenchantment among young Palestinians looking for alternatives, Hamas is moving forcefully to crush Islamic extremists with possible ties to al-Qaida who threaten Hamas' hold on power in the Gaza Strip.
That became clear last weekend during a punishing battle at a Rafah mosque that ended with the death of a charismatic, al-Qaida-admiring sheik and about 20 of his armed followers.
"Hamas saw this as a sort of threat," said Waleed al-Modallal, a political science professor and the dean of the southern Gaza Strip branch of Islamic University in Khan Younis. "They were embarrassed."
No one has a full picture of how many al-Qaida admirers might be organizing in Gaza. Hamas, however, now sees a need to quash these groups as economic and social stagnation caused by Israel's continued isolation of Gaza create an incubator for extremists presenting a more radical alternative to Hamas.
"This is a recipe for extremism to flourish," said Hamdi Shaqura, a researcher at the Palestinian Center for Human Rights in Gaza City.
The seeds for last weekend's deadly battle at the Rafah mosque were planted years ago, when Abdel Latif Moussa, a popular Islamic teacher, was booted from a southern Gaza Strip mosque in 2003 for openly praising al-Qaida leader Osama Bin Laden, his former students said.
Moussa moved a few miles south to Rafah, where young Palestinians were especially drawn to his message.
"He was an honest man, he was popular and loved," said Abdullah Shamali, 60, brother of Hamas militant leader Mohammed Shamali, who Hamas leaders said was killed while trying to broker a deal before the battle broke out. "But his speeches started to change in the last two or three months."
Moussa's militant supporters emerged in early June when they strapped explosives onto horses and unsuccessfully tried to attack an Israeli border patrol.
A few weeks later, Hamas accused the new group, Jund Ansar Allah (Warriors of God), of bombing a wedding party for a relative of Mohammed Dahlan, a key figure in the Fatah political party, Hamas' rival.
Apparently in a bid to silence Moussa, Hamas was reportedly preparing to take over the Rafah mosque.
Then Hamas leaders got word last week that Moussa was preparing to openly challenge Hamas by unilaterally declaring the establishment of an "Islamic emirate" in Rafah, the Palestinian border town known for the smuggler tunnels that link it to Egypt.
Moussa rebuffed Hamas mediation and stepped into the crowded mosque last Friday with a phalanx of young, armed militants.
Hamas responded with unforgiving force. The Rafah mosque was transformed into a concrete shell peppered by thousands of bullet holes and mortar strikes.
The fighting spilled over into Saturday and reached its climax when Moussa's militant deputy, identified as Khaled Banat, used a suicide belt to kill himself and the sheik as Hamas fighters closed in, said Ihab Ghussein, a spokesman for Hamas' Gaza Interior Ministry.
Moussa's supporters have been forced into hiding. Several said Hamas had warned them not to talk to the media. Allies from other extremist groups have vowed to strike back at Hamas.