Turkey - from reluctant observer to full player in IS fight
What is Turkey's game?
Within a week, it has gone from a reluctant observer, abstaining from military action against so-called Islamic State, to full-blown military strikes against the group, opening up its bases to coalition attacks and, simultaneously, the first aerial bombing of PKK Kurdish separatists in northern Iraq in four years.
Why the sudden turnaround?
For months, Ankara resisted military involvement in the US-led coalition of the willing. It insisted that the attacks also target President Bashar al-Assad's forces. Washington's reply was, in effect, that the immediate concern was IS and that the "Assad problem" needed to be put on the back burner.
But Turkey's second condition, that a no-fly zone be created in northern Syria, seems to have gained a little more traction.
Turkey's foreign minister now says a "safe area" along the Turkish border, free of IS militants, will be created, patrolled by coalition aircraft. That seems to have played a major role in jolting Turkey into action.
The Turkish government has long been accused of at best turning a blind eye to the rise of IS - and at worst, actively backing the jihadists against the Assad regime. It has always denied the allegation.
But last week came the suicide bombing in Suruc, southern Turkey, in which 32 died and which Turkey blamed on a militant trained by IS. And then a firefight in which IS forces shot at Turkish border guards. That was, it appears, the final catalyst for Turkish involvement.
But Ankara's strategy is complex. Alongside the IS strikes, Turkey has now bombed several PKK positions and arrested hundreds of suspected members of the group.
That, too, was prompted by last week's violence, after the PKK killed Turkish police officers in the wake of the Suruc bombing, in retaliation for what they saw as Turkey's collaboration with IS. Could Washington's tacit toleration of the PKK strikes have been the price of Ankara's involvement against IS?
Critics believe Turkey is only striking the jihadists as cover for going after its real enemy: Kurdish militants. Ankara's reluctance to hit IS earlier, the argument goes, was actually a reluctance to help Kurds fighting IS militants. Now both can be bombed, Turkey is willing to get involved.
But there's also potentially a domestic political consideration.
In June's general election, the governing AK Party lost its majority and is now in coalition talks to form a government. If that fails, new elections would have to be held in which President Erdogan would hope the AKP could win back nationalist voters who had drifted away. By hitting the PKK and potentially ending the peace process - despised by nationalists - he could well achieve that and regain the AKP majority he craves.
The danger, though, is that this two-pronged attack will expose Turkey to more attacks by IS and foment more violence among Turkey's Kurdish minority, spurred by the PKK.
Forty-thousand people died during the 30-year armed conflict between the PKK and the Turkish state. Turkey can ill afford a return to the bad old days of the 1990s. But the ghosts of the past could be reawakened.
A perilous game indeed.