MESOP TODAYS OPINION : What Comes After the Istanbul Airport Attack? – By Mustafa Akyol (NEW YORK TIMES)

30 June 2016 – ISTANBUL —(….) Since last summer, the Islamic State has been condemning Ankara as the capital of an “apostate regime” that allies itself with “Crusaders.” The group’s 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 jihadist group and Turkey have been at war since last summer, when American planes began taking off from an air base in Turkey on their missions to bomb Islamic State targets. Since January, the conflict has escalated: The Islamic State 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 the Islamic State’s grasp. Turkey also supports Islamist rebels in Syria that oppose the Islamic State.

No wonder a Turkish intelligence report warned in early June that the Islamic State 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 polarized 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 neighbors 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, demonizing 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 the Islamic State and Kurdish militants, but the Kurds are the best force against the jihadists 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. The Islamic State is not open to reason or diplomacy; the P.K.K. is, as Mr. Erdogan’s own previous peace efforts demonstrated. Turkey can return to talks with the Kurds. This would decrease the number of P.K.K. attacks and greatly improve security. It would also allow for a more effective effort against the Islamic State.

For their part, Turkey’s Western allies, especially the United States, would be wise to encourage such a rapprochement between Ankara and the P.K.K. Turkey needs all the friends it can get.

Mustafa Akyol is the author of “Islam Without Extremes: A Muslim Case for Liberty,” and a contributing opinion writer.

Follow The New York Times Opinion section on Facebook and Twitter (@NYTOpinion), and sign up for the Opinion Today newsletter.

A version of this op-ed appears in print on June 30, 2016, on page A27 of the New York edition with the headline: After the Airport Attack. Today’s Paper|Subscribe