The deadly shootout in a Gaza Strip mosque Friday between members of the ruling Islamist Hamas movement and a militant splinter group may signal further challenges to Hamas's authority in Gaza as it tries to reconcile the demands of running a government with its policy of armed conflict with Israel, according to Palestinian and Israeli analysts. After two years as the sole authority in the Palestinian enclave, Hamas is not doing particularly well on either front -- with living standards in decline under an Israeli-imposed embargo and the conflict with Israel ratcheted down since a punishing three-week war that ended in January. The battle at the mosque was waged against an organization, Jund Ansar Allah, that has carried out attacks against Israel but that had in recent months stepped up criticism of Hamas, saying it was not strict enough in its interpretation of Islam or aggressive enough in fighting Israel. The group, influenced by al-Qaida, was blamed for recent attacks on Internet cafes, beauty salons and other targets in Gaza it considered an affront to its vision of Islam. Hamas, a Sunni organization that began as an offshoot of Egypt's Muslim Brotherhood, is supported by Syria and by the Shiite government in Iran, but its leaders say their aim is only to challenge Israel -- not participate in the type of broader war with the West that al-Qaida advocates. 'The objective conditions in Gaza -- poverty, the siege, restriction of movement, lack of services -- are bound to create more and more destabilizing factors. It is fertile ground' for militants, said Ziad Abu Amr, a member of the Palestinian Legislative Council elected from Gaza as an independent. Although a successful challenge of Hamas is unlikely in the near term, he said, 'Hamas cannot count on this forever. There can always be changes. We saw an example' Friday. Hamas health officials said 22 people were killed during several hours of fighting between Hamas security forces and gunmen loyal to Abdel Latif Moussa, a physician and cleric who, after weeks of tension with the government in Gaza, on Friday declared his neighborhood in Rafah an Islamic emirate. Hamas security forces surrounded the mosque after Moussa arrived there with armed backers. Officials said Saturday that they had little choice but to confront such a direct challenge. Ahmed Yousef, a senior Hamas member, said that there had been several meetings with Moussa in recent weeks and that 'we hoped that he would come to this Friday's sermon to ease the tension. We were stunned when he brought those militants to stand beside him. It was a total violation of the law and a revolt against the government.' Moussa and a top aide, Abdullah Muhajir al-Souri, were killed in the fighting. Hamas officials said the two died when one of them detonated a suicide belt. The blast also killed a Hamas mediator, Hamas officials said. Five other Hamas security officers and one child also were killed. About 120 people were injured in the fighting, which began early Friday evening and continued through the night at the mosque and at other locations where Moussa and his fighters fled. Yossi Kuperwasser, a brigadier general in the Israeli reserves and former head of research with Israeli military intelligence, said the fighting Friday was evidence of a predicament faced by Hamas: whether to sustain the armed conflict with Israel that is at the core of the group's ideology or to take the steps needed to end years of international economic and political isolation. The United States, the European Union and others have demanded that Hamas end violence and recognize Israel as a condition of joining international peace efforts. 'Hamas was hesitant to take steps against those guys until now. They shot at us several times from within the Gaza Strip, and Hamas closed their eyes. They thought they could handle it or even get benefit out of it,' Kuperwasser said. 'That was a mistake.' Anat Kurz, a specialist on Palestinian politics at Tel Aviv University's Institute for National Security Studies, said the uprising against Hamas could deepen the contrast developing between Gaza and the West Bank, where the more moderate Palestinian Authority is assuming greater control over local security and seeing the beginnings of an economic upturn. The division in Palestinian society is considered a barrier to any peace agreement with Israel, and it remains unclear when or how Gaza and the West Bank will be brought under a single government. Hamas seized control of Gaza in 2007. People in Gaza 'see some kind of normal life back in Ramallah and Jenin, and they are asking questions,' Kurz said. 'Some are drifting to the fringes, and others are pressing Hamas to do something that would give a reason for all this suffering.' Israel began imposing restrictions on Gaza after Hamas won parliamentary elections in 2006, and it toughened the sanctions when the Islamist group took over Gaza. Yousef said that the battle at the mosque showed that Hamas remains strong and that little further opposition was expected from a handful of fundamentalist groups active in Gaza, which he said have minimal support. If anything, he said, Hamas's willingness to confront organizations influenced by al-Qaida should make U.S. and other Western powers more open to engagement. Special correspondent Islam Abdel Kareem in Gaza City contributed to this report. 