A potentially momentous shift in the Middle East was signalled this week as Turkish warplanes attacked Islamic State positions in Syria and the Ankara government finally agreed that the US can use Turkish bases for its missions against Isis. A big security sweep, detaining people suspected of being Isis agents and Kurdish militants, accompanied these military moves. If Turkey continues in this new direction, the air campaign against Isis will be strengthened and the flow of people, money and arms through Turkey to Isis in Syria will be curtailed. But the way in which both Isis and the Kurdistan Workers’ party, or PKK, have both been targeted suggests the outcome may also be complicated and dangerous on the ground in Turkey itself.

The problem is that Ankara has been trying to keep Isis and the PKK in play against each other. Although it has been conducting negotiations with the PKK, the long-established and substantial Kurdish separatist movement in Turkey, and its imprisoned leader Abdullah Öcalan, since 2012, it has also been looking the other way and perhaps has even been helping, as Isis has battled the PYD, the PKK’s sister party in Syria. Such a contradictory policy, the left hand not knowing what the right hand was doing, was almost bound to go wrong at some stage. The Turkish government may thus have acted now because it feared an outbreak of hostilities between the PKK and Isis on Turkish soil after a suicide bombing attack earlier this week, attributed to Isis, which killed 32 people in a town near the Syrian border. That was followed by PKK attacks on Turkish police, supposedly for failing to protect Turkish Kurds.

The opposition press was full of angry charges that the government had failed to take a tough line against Isis. It certainly looks as if a war that Turkey had managed to keep at one remove now threatens to spill over the border, largely because the policy of manipulating two enemies was inherently risky as well as duplicitous.

Turkey has been an uneasy member of the coalition against Isis, for reasons to do both with its disappointed ambitions to lead and shape the region and its anxieties about how the conflict might strengthen Kurdish separatism on its own territory. Indeed, the main key to the equivocal position of Turkey on the struggle to contain Isis has from the beginning been its fear that the Kurds might eventually emerge as winners in both Iraq and Syria, emboldening Turkey’s own Kurds to demand an autonomy that would threaten the centralised Turkish state.

Ankara’s ideal post-Isis world would be one in which both Syria and Iraq come back to life as strong nations, controlling and satisfying their Kurdish minorities, and thus leaving Turkey free to pursue a settlement with its own Kurds which would make only limited concessions to their desire for autonomy. Turkey tried and failed to broker a compromise in Syria, then turned against Bashar al-Assad, attempting to mix and match support for some rebel groups there, while avoiding commitments that might help the Syrian Kurds. This week’s developments may bring Turkey more fully into the alliance against Isis, but the country should also be refreshing its peace talks with the PKK, rather than taking action that unfairly and unwisely brackets the Kurdish movement with the Islamists.