NINE months after a devastating war with Israel, Gaza’s militants have been turning their weapons on each other. On May 4th a little-known group calling itself the Supporters of the Islamic State in Jerusalem gave an ultimatum to Hamas, the less-extreme Islamists who control the strip: release our prisoners within 72 hours or face attacks.

Within hours a bomb went off outside the security headquarters in Gaza City. No one was injured. Four days later the group shelled another Hamas compound, this time in the city of Khan Younis, at the southern end of the strip, and promised more violence. The authorities have been rounding up suspected enemies: more than a dozen new prisoners have been taken in the past few days.

The perpetrators of the attacks have tried to link themselves with the jihadists who control a large swath of Syria and Iraq. But they have not formally sworn allegiance to Islamic State, nor has the latter acknowledged having a presence in Gaza. Instead this looks like a genuinely home-grown problem.

The legitimately elected men of Hamas are hardly Jeffersonian democrats, but they have long clashed with local Salafists, ultra-radical Muslims who believe Hamas is both too liberal and too soft on Israel. In past years Salafists bombed internet cafes and video shops, and plotted attacks against Western targets. The leader of an al-Qaeda-inspired group even declared an Islamic emirate in Gaza back in 2009. Retribution was swift: Hamas gunmen stormed his mosque, killing him and dozens of others in an hours-long shootout.

Violence ebbed after that, as Hamas consolidated its control, but it has flared up anew since last summer’s war. Public anger is high, with tens of thousands of people homeless and half the population unemployed—fertile ground for radical groups to find new recruits.

The French cultural centre in Gaza has been bombed twice in eight months. Prominent intellectuals and artists received death threats in December from a group calling itself Islamic State. Last month, a bomb went off near a United Nations building.

Officially, at least, Hamas denies that there is a problem. “There is no Islamic State in Gaza,” said Mushir al-Masri, a senior Hamas official. “This extremism is a recent phenomenon in some areas… but in Gaza this environment does not exist.”

Privately, they are concerned. After the group delivered its ultimatum to Hamas earlier this month, security forces set up dozens of checkpoints across the strip. They also stepped up patrols on the border with Israel, fearing that Salafist groups might launch attacks and invite Israeli retaliation. Police bulldozed a mosque last month, and dozens of people have been arrested, although Hamas did in fact release Adnan Mayyat, the sheikh whose arrest prompted the original deadline.

The UN has raised its threat assessment in Gaza, fearing that extremist groups might target its employees. Kidnappings are rare: the last foreigner abducted in Gaza was Vittorio Arrigoni, an Italian activist murdered by Salafist militants in 2011. Diplomats and aid workers worry that may change.

Israel, too, is keeping a wary eye on the situation. The head of the army’s southern command acknowledged last week that Israel and Hamas, despite their repeated wars, shared a few “common interests”, particularly stability in Gaza. “Right now, there is no alternative to Hamas as the sovereign in Gaza,” General Sami Turgeman told local officials. “They don’t want a global jihad. It threatens them as well as us.”