The killing by an Islamic State (Isis) gunman of 39 civilians in a nightclub in Istanbul is the latest massacre in Turkey, where such slaughter is now happening every few weeks. The perpetrators may differ but the cumulative effect of these atrocities is to persuade Turks that they live in an increasingly frightening and unstable country. It is also clear that the Turkish government does not know what to do to stop the attacks.

These are likely to continue with unrelenting savagery whatever the government does, because Isis is too big and well-resourced to be eliminated. It is well rooted in Turkey and can use local militants or bring in killers from abroad, as may have happened at the Reina nightclub and was the cae in the assault on Istanbul's Ataturk Airport earlier in the year.

As in France, Belgium or Germany, it is impossible to stop attacks when ordinary civilians are the targets and the killers are prepared to die. Their success is often blamed on “security lapses” but in practice no security will provide safety.

What makes “terrorism” in Turkey different from Europe and the Middle East is not the number of dead – more are killed by Isis in Baghdad every month – but the diversity of those carrying them out. Three weeks ago, the killing of 44 people — mostly policemen — outside a football stadium in Istanbul was claimed by the Kurdistan Freedom Falcons (TAK), allegedly an arm of the Kurdistan Workers Party (PKK). The assassination of the Russian ambassador to Turkey in Ankara on 19 December was blamed by President Recep Tayyip Erdogan on a third group, the followers of Feithullah Gulen, who are held responsible for the failed military coup on 15 July.

All these are powerful groups with thousands of committed members inside and outside Turkey and none of them are going to go out of business soon. The government in Ankara is making the usual noises about tracking these different groups “to their lairs”. but this will be easier said than done. Both Isis and the PKK have established powerful de facto states in Syria and Iraq, something that could only have happened because of Erdogan’s ill-conceived involvement in the Syrian civil war after 2011.

Footage shows gunman unleash wave of bullets outside Istanbul nightclub

Isis, which once used Turkey as a transit point and a sanctuary, now denounces it as an enemy and has calibrated its assaults to cause maximum divisions. A striking feature of Turkish reaction to the attacks over the last two years is that it has not led to national solidarity but has, on the contrary, provoked pro and anti-Erdogan forces to blame each other for creating a situation in which terrorism flourishes.

There is another menacing aspect of the attack on revellers in a nightclub: it is evidently levelled at seeking the sympathy or support of puritanical Islamists. The Salafist creed is spreading in Turkey and providing fertile soil for Isis cells established over the last few years.