Istanbul shooting
There are no quick or easy solutions to Turkey's terrorism crisis. However if the crisis is to be overcome Turkey urgently needs to reconcile with Syria and Iraq, in order to secure peace and establish good neighborly relations with these countries, ending the threat of Jihadi terrorism spreading to its territory. Turks also urgently needs to focus on the fight against ISIS, work for better relations with Russia, and in the long term seek reconciliation with the Armenians and the Kurds.

The murderous attack on New Year's Day on a nightclub in Istanbul is merely the latest in a string of terrorist attacks in Turkey.

Responsibility for the New Year's Day attack has been claimed by ISIS. ISIS has also claimed responsibility for previous terrorist attacks in Ankara in October 2015 (which killed 100 people) in January and March 2016 in Istanbul, on Ataturk airport in Istanbul in June 2016 (which killed 45 people) and in August 2016 in Gaziantep (which killed 54 people).

ISIS is not the only terrorist organization operating in Turkey. The TAK ("Kurdistan Freedom Hawks") has claimed responsibility for a car bomb attack on a transport hub in Ankara in March 2016, which killed 37 people, and it previously launched an attack in February 2016 on military buses in Ankara, which killed 29 people.

More recently, on 19th December 2016, Andrey Karlov, Russia's ambassador to Turkey, was shot dead in Istanbul by a gunman who the Turkish authorities say had connections to the Gulen movement but who shouted words after the killing which appeared to associate him with the militant Jihadist groups fighting the government of Syria.

This is a terrible pattern of extraordinary violence, and it shows the extent to which Turkey has been destabilized by events in neighboring Iraq and Syria.

It is often said that Turkish President Erdogan's policies have contributed to this violence, and unfortunately that is true. His decision to commit Turkey to the cause of regime change in Syria has made Turkey the main base for Jihadi fighters pouring into Syria to wage their war there. The result is that Turkey is now awash with violent men with guns, with worrying signs that some sections of Turkey's own population are becoming radicalized.

President Erdogan's ham-fisted policies have no doubt also played a role in escalating the crisis with the Kurds, though it should be said that the conflict between the Turkish state and the Kurds is very longstanding, and President Erdogan is its inheritor not its creator.

It should be said clearly however that by far the greatest cause of Turkey's current terrorism crisis is Western policy, which by causing wars in Iraq and Syria has fostered the rise of violent Jihadism in the region, leaving Turkey desperately exposed.

Unfortunately there is no simple solution to this problem. Though Turkey has become increasingly opposed to ISIS over the last year - after having previously flirted with and covertly supported it - the Turkish army's recent defeat by ISIS near Al-Bab shows what a tough enemy for Turkey ISIS is.

The recent rapprochement with Russia may be in part intended to win for Turkey a strong ally against ISIS. However as the Russian-Turkish ceasefire plan for Syria shows, the price is the abandonment of the regime change project in Syria.

In the short term this creates risks for Turkey. Any move by Turkey to scale down its commitment to the Jihadis fighting for regime change in Syria risks enraging the Jihadis and their supporters within Turkey itself, risking a violent backlash and a much greater spike in terrorist violence there.

As for the Kurds, in the earlier years of his administration President Erdogan and his party made a sustained and partially successful attempt to reconcile with the Kurds. As President Erdogan has however come to base his appeal increasingly on Turkish nationalism that has however become more and more difficult. With the Turkish army now fighting the Kurds in Syria and within Turkey itself, and occupying stretches of Iraqi Kurdistan, the fear has to be that relations between the Erdogan government and the Kurds have passed the point of no return.

Besides for many Turks, including for many of Erdogan's supporters, Kurdistan is an existential issue, which strikes at the very heart of Turkey's existence as a nation and as a state. Suffice to say that there are reports that the plotters behind the July coup attempt in Turkey intended to put Erdogan on trial for treason because of his previous concessions to the Kurds.

This makes it very difficult to see what Erdogan can offer to the Kurds that would satisfy the more radical elements amongst them, who are behind the recent terrorist violence, but which would not antagonize large swathes of Turkish opinion, including many of Erdogan's own supporters.

When Turkey suffered an earlier bout of terrorist violence in the 1970s the result was the 1980 army coup. Though that was carried out with great brutality, it did at least stabilize the situation in Turkey.

Whether following the debacle of the July coup attempt the Turkish army is now in any condition to carry out a coup is very debatable. Besides Turkey's future ultimately depends on its breaking the cycle of violence and military repression which has been the pattern of Turkish politics since the 1960 coup, and which have up to now held it back. President Erdogan for all his faults had appeared until recently to be making real progress in that direction. Another coup would be a gigantic step back.

Though it is not easy to see an immediate way out of Turkey's current crisis, I would say that those people who sometimes give the impression of wanting Turkey either to break up or to descend into civil war should be careful what they wish for.

Not only would that be a disaster for Turkey's people, but given Turkey's size and importance it would also be profoundly destabilizing for the Middle East and for Europe, and indeed for the whole world generally. Suffice to say that the biggest short term beneficiaries would be the various extreme Jihadi terrorist movements, first and foremost Al-Qaeda and ISIS.

Having said all this, though it is not easy to see a quick way out of the crisis, it is nonetheless possible to identify certain things that can be done, and which should be done, and moreover without delay.

Firstly, it is in Turkey's imperative interest that ISIS be destroyed, and that peace and good neighborly relations be restored with Iraq and Syria.

If that means cooperating with Russia and giving up on the regime change project in Syria, then that is a price Turkey's leaders must pay in the interests of their people and their country. Whilst doing so will inevitably cause a short term spike in terrorist violence inside Turkey, Russia's and Pakistan's experience in defeating Jihadist terrorism on their territories shows that with good intelligence and single-mindedness it can be done.

Whilst Turkey with its Muslim population would face a huge challenge, it would have no shortage of allies in such a struggle. The overwhelming majority of Turks have no time for violent Jihadism (I know Turkey sufficiently well to be able to say this with confidence), and if they were given a strong lead by their leaders I have no doubt they would support a Turkish government committed to fighting Jihadism on their behalf, just as Russians were after Putin became President.

Given time I am sure the challenge of Jihadi terrorism within Turkey can be overcome.

The alternative, of trying to keep the regime change project in Syria alive by prolonging the war there can only in the end make the internal situation in Turkey worse, and the problem of Jihadi terrorism within Turkey much greater and more intractable.

As for the Kurds, some sort of reconciliation with them - and incidentally also with the Armenians - is essential for Turkey's long term future. In my opinion it can be done without endangering Turkey's integrity or existence as a state, though unfortunately I doubt it will happen soon, or that President Erdogan is the man to do it.

In the meantime some sort of deal involving the Kurds in Iraq and Syria is essential, and realistically that too cannot happen without peace and the restoration of good neighborly relations with Iraq and Syria, and without some sort of partnership with Russia and Iran, the traditional friends of the Armenians and the Kurds.

Saying all this makes clear which countries Turkey should prioritize in seeking better relations. Whatever lingering feelings Turks may still have for the European Union, it cannot help Turkey in its present predicament.

There are times when President Erdogan - or at least some members of his government - say and do things which show that they have at least some understanding of what they need to do. The rapprochement with Russia, and the Russian-Turkish ceasefire plan for Syria, are two examples.

However if so then they also need to understand that doing these things is simply not reconcilable with the megalomaniac language and projects that President Erdogan unfortunately is all too manifestly given to. Stealing a march on the Russians by launching Operation Euphrates Shield may appear clever. In reality it is not clever at all if it bogs Turkey down in a quagmire in Syria, and if it enrages the Kurds, the Syrians, the Iranians and the Russians, with all of whom Turkey in its own interests urgently needs to reconcile.

Turkey's leaders - first and foremost President Erdogan - have some very difficult decisions to make in the weeks and months ahead. In the interests of Turkey's people it is to be earnestly hoped that they will rise to the occasion and make the right ones.