While Turkey's policies appear to help ISIS, it is actually more interested in fighting the Kurds.

Turkey’s decision to start bombing insurgent targets in northern Syria early on Friday and grant NATO allies use of its İncirlik Air Base to carry out similar attacks marks a significant shift in policy. Five years into the Syrian war, the country is finally confronting some of the problems it helped create.

Turkey, which houses around 1.7 million Syrian refugees, had urged its Western allies for years to enforce a no-fly zone over Syria or erect civilian safe havens there. But its own policy has contributed in no small measure to the two threats it now faces along its southern frontier.

The first is the Islamic State militant group. Although Turkey denies it ever abetted the Caliphate—which controls swaths of the desert between Aleppo in the northwest of Syria, Mosul in the north of Iraq and Ramadi to the south, near Baghdad—it allowed weapons and foreign fighters to cross the border from 2012 to 2014, hoping this would put pressure on the regime of President Bashar al-Assad.

Turkey also did support less fanatical, more like-minded Islamists in Syria, seeking to take advantage of what was then seen as another “Arab Spring” uprising to reassert its influence in the Middle East.

From the start, Assad insisted that the rebellion against him wholly consisted of radical Islamists. He helped make that a reality by concentrating on militarily defeating the relatively moderate opposition forces in the south, letting extremists out of jail while locking up peaceful protesters and largely shying away from battling the Islamists in the east of the country.

Turkey’s Recep Tayyip Erdoğan argued last year it was Assad who had “left space” for radical groups like the Islamic State. “He was the one who prepared the ground for this,” Erdoğan said .

But the Turkish leader is not without blame himself.

While letting through radicalized European Muslims to wage jihad in Syria, Erdoğan stoked Sunni resentment in Iraq by accusing the prime minister, Nouri al-Maliki, of privileging his Shia sect to the detriment of the rest the country.

Maliki did. But it’s doubtful if Erdoğan’s fulminations—and his undermining of the Iraqi central government by trading oil with the autonomous Kurds in the north—did much to improve the situation.

Disaffected Iraqi Sunnis went on to either support or tolerate the militants of the self-declared Islamic State when they conquered Mosul, the second-largest city in the country, a year ago.

Even as Turkey’s Western allies started seeing the Islamic State as a bigger threat to regional security than Assad, Erdoğan did not join their air war against the group nor would he let the Americans—until last week—fly missions out of İncirlik, a base they were able to use in the last decade to support the wars in Afghanistan and Iraq.

Given that Turkey’s apparent change of heart comes at a time when Kurdish rebels are making gains in Syria, there is a not altogether unreasonable suspicion it really cares more about the second security challenge it has inadvertently exacerbated: Kurdish independence.

While its jets are bombing Islamic State positions in Syria, Turkey’s security services are rounding up Kurdish and other “marginal leftist” activists at home, Prime Minister Ahmet Davutoğlu said on Friday.

His and Erdoğan’s Islamist Justice and Development Party (AKP) made some effort to end the Turkish state’s thirty-year war with Kurdish separatists before the election in June. That reconciliation process stalled when the pro-Kurdish and left-wing People’s Democratic Party (HDP) denied the ruling party another majority by clearing the 10 percent election threshold for the first time.

Although there is little to substantiate AKP claims of collusion between the HDP and the Kurdistan Workers’ Party (PKK)—a terrorist organization—the Kurds’ ability to finally have an impact on Turkish politics coincides with a rising momentum for Kurdish ambitions across the border.

The PKK does collaborate with Kurdish fighters in Syria while the president of Iraqi Kurdistan, Masoud Barzani, has admitted that Syrian Kurds received military training there.

The civil war in Syria has already made a mockery of the state borders between the Kurdish areas of Iraq and Syria. Turkey, blindsided by its hegemonic ambitions against Iraq’s Maliki, undercut its own border with the Kurdistan Regional Government by buying their oil over objections from Baghdad. Kurdish dreams of linking up their territories and declaring an independent Kurdistan have never seemed more likely to come true.

For Turkey, this is a nightmare.

Erdoğan said last month he would “never allow” a Kurdish state to be declared on Turkey’s border, let alone one that includes his own country’s Kurds.

Despite waging a brutal war on the Kurds in the 1980s and 1990s that saw thousands of villages wiped off the map and hundreds of thousands of Kurds displaced, Turkey’s largest minority still accounts for up to a fifth of the population. And Kurds are reproducing faster than ethnic Turks. Women in Kurdish-speaking areas typically have between three and five children against two for Turkey as a whole. Within a generation, half the recruits to the Turkish army—the largest in NATO after the United States—could come from Kurdish areas.

If an independent Kurdistan emerges from the turmoil in Iraq and Syria, the pressure on Turkey to allow its Kurds to join such a state could prove unbearable. It would then lose between a quarter and a third of its territory as well as its borders with Iran, Iraq and possibly Armenia, relegating it the ranks of lesser powers in the region.

It’s too late for Turkey to nip the specter of Kurdish secession in the bud. The PKK is restarting its war on the Turkish state, killing four policemen and injuring several more in recent days in what it described as retaliation for a bomb attack a week earlier in Suruç, a largely Kurdish town close to the Syrian border. An Islamic State supporter killed 32 activists and aid workers there.

But Turkey can try to stop the situation from escalating by blocking the formation of a Kurdish state in Syria.

Islamic State forces now control territory north of Aleppo, once the country’s most populous city, splitting the Kurdish-controlled areas to the west and east in two. The Kurds want to push the Islamists south and link up their territories. This is exactly where Turkey is intervening, purportedly to overpower the caliphate and create a humanitarian safe zone—under its protection.

Turkey’s real objective is likely to be twofold: push back the Islamic State and then fill up “liberated” Syria with refugees to prevent a Kurdish entity from controlling the whole other side of the border.

Nick Ottens is the editor of the transatlantic news and opinion website Atlantic Sentinel and a project manager at Wikistrat, the world’s first crowdsourced consultancy.

Image: Flickr/ Asitimes