The towering Ibn Taymiyyah Mosque, a white stucco building with blue glass, stands within sight of the Egyptian border, close to Rafah's infamous tunnels that supplied Gaza with food and arms over the past five years. The mosque is named for the 14th century Muslim scholar who combined a love of jihad with a hatred of anything unorthodox.
This is the community from which Hamas sprang, where the Muslim Brotherhood ruled the roost under men such as Sheik Ahmed Yassin, the blind paraplegic preacher, and where devoted Hamas youths stared down Israeli tanks.
But in the summer of 2009, it was the scene of a bloody battle between Hamas forces and the new kids on the block who challenged the authority of Hamas.
Abdel Latif Musa, a leader in the Salafi-Jihadist community, had summoned people to join him in declaring an Islamic state. It was an effort to expose the failure of Hamas to establish such a thing. More than 2,000 people turned up.
Hamas would have no part of it and, after two days of fighting, Sheik Musa and 23 of his followers lay dead. Dozens more were thrown into prison.
Jamil and Ahmed were among them. A close disciple, Jamil, 24, says he saw his leader narrowly escape an explosion only to be shot point blank.
"Hamas killed him," Jamil said. "They knew they had to; otherwise his following would have grown too large for them to bear."
So-called Salafi-Jihadists are found in rapidly growing numbers throughout the Middle East and across North Africa, even as popular uprisings are awakening democratic secular alternatives.
These are people who seek to return Muslim lands to the ways of their pious ancestors ( salaf means forefather), strictly adhering to the Koran and eschewing any compromise with the unbelieving West.
In the Palestinian territories these people believe Hamas is deviating from the Islamic path by its willingness to reconcile with the secular Palestinian Authority and by indicating its acceptance of a sovereign Palestinian state in the West Bank and Gaza Strip. They fault the group for not imposing strict Islamic law in the Gaza Strip and for curtailing violent resistance against Israel, the country that occupies historic, formerly Islamic Palestine.
These fundamentalists even oppose democratic elections - considered a heresy for putting man's will above God's will - and criticize Hamas for taking support from Iran, considered a perverse nation for following Shiism, a 7th century movement that broke away from the "rightly guided" and more numerous Sunni Muslims.
The Jund Ansar Allah (Soldiers of God's Supporters) led by Sheik Musa was once one of the largest of Gaza's Salafi-Jihadist groups. Greatly reduced by the Hamas crackdown two years ago, it is returning in size, as evidenced by recent Friday prayers, even under the watchful eyes of Hamas security forces.
"Of course, it's growing," said Nabil, more an observer than participant, in whose home the two Salafi-Jihadists felt comfortable meeting a Western correspondent. "This is a government of Hamas, for Hamas," he said, "not an Islamic government."
The streets of this dusty border town and refugee camp are where future Hamas leaders such as Ghazi Hamad and Ahmed Yousef grew up, swore oaths of loyalty to the Muslim Brotherhood and plotted resistance to Israeli occupation.
Theirs is a generation of Hamas leaders, now mostly in their 60s, that wants to deal, that's willing to agree to establishing a Palestinian state within Gaza and the West Bank as defined by the Green Line, the ceasefire line that separated Israelis from Jordanian and Egyptian forces until June, 1967. Even these relative moderates, however, insist that their oath and the Hamas covenant preclude them from recognizing Israel, though they would agree to a long-term (10-20 years) truce between the two sides.
During that time, says Mr. Yousef, an adviser to Hamas Prime Minister Ismail Haniyeh, "I do believe we'll learn to live with each other."
But changing demographics and rising religiosity threaten that vision.
Eyad Saraj, a Gaza psychiatrist and human rights activist, recently warned "if there is no political solution to the division between Hamas and Fatah and no end to the siege, extremism will flourish."
Already there have been signs of Salafi-Jihadists inside Hamas's own military wing, the Ezzedeen al-Qassam Brigades.
In April, Vittorio Arrigoni, an Italian activist, was abducted and murdered in Gaza by a small group of men who demanded the release from Hamas prison of a leading Salafi-Jihadist. Several hours before the deadline, however, they strangled the Italian.
It turned out that two of the three perpetrators were members of Hamas's own security forces - one a policeman, the other a member of al-Qassam.
This is "the real danger," says Ayman Batniji, a charismatic imam at Gaza's Shohada al-Aqsa Mosque and the spokesman for the Hamas police - "those inside Hamas's military wing that are loyal to the [Salafi-Jihadist]views."
Such people are believed to have been responsible for a series of attacks on United Nations summer camps for children last year, and for setting fire to a Gaza water park.
Mr. Batniji said that after the Ibn Taymiyyah trouble, Hamas tried a policy of re-educating Salafi-Jihadists in prison.
"They call themselves 'religious' but some of these people don't even know how to prepare for prayer," said Mr. Batniji, scornfully. "We sent scholars to them to convince them of the errors of their ways."
It didn't work very well, Mr. Batniji acknowledged. "Now [after the activist's murder]we must use force with them."
Indeed, when Hamas uncovered the hideout of the three men who allegedly murdered the Italian, only one of them was carried out alive. Hamas officials insist they tried to capture them, but say the ringleader, a Jordanian who arrived in Gaza in a 2009 aid convoy, killed one of his Palestinian cohorts, and then committed suicide.
That still didn't prevent Hamas from putting up large posters at mosques across Gaza, warning people of what lay in store for any who tried such extremist acts.
Mr. Batniji is personally torn by this whole situation. His own beliefs are not far off those of Salafists.
"Yes, I believe God's laws are greater than man's laws, but we can't implant sharia all at once," he said. "It must be done gradually."
A father of four, Mr. Batniji served for a few years as a policeman in the Fatah-ruled Palestinian Authority - until the 1990s, when he was one of the police officers who arrested Abdel Aziz Rantisi, a leading figure in, and future leader of, Hamas.
"He was a great man," Mr. Batniji recalled, gazing on the two large photos of Dr. Rantisi he has on display in his living room "- so quiet, so respectful, but so commanding."
The scales fell from Mr. Batniji's eyes the day he put the cuffs on Dr. Rantisi, and he left the PA police force, joined Hamas and threw himself into religious studies.
It was from the uncompromising Dr. Rantisi, Mr. Batniji said, that he drew his great contempt for Israel, a state that, he warns, will soon come to an end.
"Israel is occupying Muslim land," said Abu Abdullah al-Ghazawi, one of several names used by the elusive leader of Jaysh al-Umma (Army of the Nation), one of Gaza's largest Salafi-Jihadist groups. "When any part of Muslim land is taken, it is the duty of all Muslims to expel the occupiers by any means," he said. "There are no compromises; we must resist."
"Who are they to tell us about resistance," asks Ghazi Hamad, recently appointed Hamas's Deputy Foreign Minister. "No one is more experienced in resistance than Hamas. No one has more martyrs."
"Resistance has cost Gaza a lot of lives and a lot of damage," Mr. Hamad said. "We need to evaluate each situation" before waging resistance.
That may be but, as Issam Younis, the director of Gaza's Al Mezan Centre for Human Rights, says, there are two sides to Hamas. "It's quite clear that the dominant stream advocates governance, truce with Israel, gradual implementation of law and accepting what the population wants. The other, weaker side is more conservative, more salafi, an outlook many of them acquired while studying in Saudi Arabia and Sudan."
The question is: Which side of Hamas will prevail?