ISTANBUL - On Tuesday night, just as millions of Muslims here were breaking their Ramadan fasts, three terrorists attacked the city's busy airport. They fired randomly at passengers with automatic weapons before blowing themselves up. They killed 41 innocent people, most of them Muslims, supposedly in the name of Islam.
The assault on the airport is the latest in a series of horrible traumas in Turkey. In the past year, the country has endured almost a dozen major terrorist attacks. Some were the work of the Islamic State in Iraq and Syria (ISIS), which kills in the name of God; others were the work of the Kurdistan Workers' Party (PKK), which kills in the name of the people.
This country was much more peaceful a year ago. It was only last summer that a two-year-old peace process between the government and the PKK fell apart. Meanwhile, ISIS, which initially benefited from Turkey's lax control of the Syrian border, began to carry out its violence inside Turkey. Its suicide bombers first aimed at secular Kurds, then Western tourists and, finally, random people at the airport.
Since last summer, ISIS has been condemning Ankara as the capital of an "apostate regime" that allies itself with "Crusaders". Its Turkish- language magazine proclaimed: "O Istanbul, you have allowed disbelief in your avenues. You have filled your streets with sins, but surely you will be conquered."
The militant group and Turkey have been at war since last summer, when American planes began taking off from an airbase in Turkey on their missions to bomb ISIS targets. Since January, the conflict has escalated: ISIS began shelling the border town of Kilis, and the Turkish army retaliated. More recently, Turkey supported an operation by a rebel group called the Syrian Democratic Forces to wrest the town of Manbij in northern Syria from ISIS' grasp. Turkey also supports Islamist rebels in Syria that oppose ISIS.
No wonder a Turkish intelligence report warned early last month that ISIS would soon seek revenge. The group can hit soft targets inside Turkey, the report added, specifically mentioning Istanbul's airport. Sources say that thanks to this warning, security had been heightened at the airport, perhaps preventing more deaths.
Where will we go from here? The reaction from the government is sure to be severe. Raids on Islamic State cells in Turkey will most likely increase. So will airport security. Intelligence efforts will be stepped up and the border monitored more closely. But security and intelligence measures alone won't bring an end to the bloodshed.
Turkey has become so vulnerable lately because it is polarised internally and isolated externally. This is not the result of a "global conspiracy", as President Recep Tayyip Erdogan's propaganda machine keeps saying. It is the result of the President's rigid, divisive and combative policies. He has picked fights with our neighbours and tried to crush his opponents at home.
Now, his government is finally taking steps to repair some of the damage. The start of reconciliation with both Israel and Russia, which came as happy news just before the airport attack, are steps in the right direction. A pledge by Prime Minister Binali Yildirim seems promising: "We will increase the number of our friends; we will decrease the number of our enemies."
But Turkey's government needs fewer enemies inside Turkey as well. That would entail a reversal of the authoritarian tactics that Mr Erdogan has pursued for five years - suffocating the press, demonising opponents, taming the judiciary and imposing religious conservatism.
The Turkish government also has to solve a strategic problem: Its "war on terror" has two conflicting objectives. It fights both ISIS and Kurdish militants, but the Kurds are the best force against the militants on the other side of the Syrian border. That not only puts Turkey sometimes at odds with its Western allies, but it also hurts Turkey's chances of ending terrorism.
The government needs to decide with which of these two terrorist forces it can negotiate. ISIS is not open to reason or diplomacy; the PKK is - as Mr Erdogan's own previous peace efforts demonstrated. Turkey can return to talks with the Kurds. This would decrease the number of PKK attacks and greatly improve security. It would also allow for a more effective effort against ISIS.
For their part, Turkey's Western allies, especially the United States, would be wise to encourage such a rapprochement between Ankara and the PKK. Turkey needs all the friends it can get.
NEW YORK TIMES
• The writer is the author of Islam Without Extremes: A Muslim Case For Liberty.
This article was first published on July 01, 2016.
Get a copy of The Straits Times or go to straitstimes.com for more stories.