Amid turbulent changes in the Middle East, Turkey’s relations with the Iraqi Kurds have been giving much hope for further mutually enriching cooperation between Ankara and Erbil.Since 2002 the AKP government has managed to increase ten-fold its exports to the KRG, from $700 million to more than $8 billion. Turkey’s investments, however, were not limited to economy and trade. Military cooperation between the KRG and Turkey has for years been limiting PKK activity in the region. Until recently the Turkish leadership was happy to receive Iraqi Kurdistan Region President Masoud Barzani in Ankara. Turkey got used to perceiving the Iraqi Kurds as their friends who would always pay due attention to Ankara’s opinions on matters that could concern both sides.No wonder the Turkish government was frustrated to witness how the KRG leadership staunchly mobilized for an independence referendum this September. The KRG’s decision to hold a referendum despite Turkey’s strong objections and threats to sever the ties nourished for so many years were evidence of Turkey’s limited influence on the Iraqi Kurds. The sense of deep frustration and the realization that it had almost no effective means to dissuade the Kurds from this step ultimately pushed Turkey into more cooperation with Iraq and Iran.When on October 16, 2017, Iraqi security forces launched a military operation against Kurdish held territories, Turkish officials thought it necessary to assist the efforts and decided to seal off national airspace for the KRG. Further moves involved imposition of customs limitations on the border. Clearly, the Turkish government had by then enough reasons to endorse these radical measures of the Iraqi central government. For Ankara, Kurdish withdrawal from disputed areas implies that Iraq’s territorial integrity is secured again, while demographic issues in oil-rich Kirkuk and the presence of the PKK on the Iraqi-Syrian border have a real chance to be properly addressed. While Turkish President Recep Tayyip Erdogan was lambasting Barzani for his reluctance to follow Turkey’s friendly advice to give up on the referendum and to return Kirkuk to Iraqi sovereignty, the main pro-government newspapers were exalted to witness the Kurds’ hopes for an independent state vanish under the advancing government forces.The schadenfreude, however, may have obscured the real picture unfolding now in Iraq: almost every serious crisis in the Turkish neighborhood results in the increased influence of Iran, which is set to exploit every opportunity to fill the power vacuum. This may be relevant for the Kirkuk crisis as well, and could eventually mean that Turkey’s problems with the Iraqi Kurds shift into the realm of Turkey’s relations with Iraq and, by extension, Iran.Resolving issues vital to Turkish national security and foreign policy not opposite the KRG, but rather with Iran, may be much harder for Turkish diplomats. All things on the ground indicate that Iran’s presence in Iraq’s political body and military bureaucracy as a result of the successful military campaign against the Kurds may be further cemented and even widened, effectively meaning that Turkish relations with Iraq will be conjoined with Iranian ambitions in the wider region. Turkey thus may find itself in a situation where it has to deal with an actor against which it has a limited scope of effective tools.The issue of Turkish military presence in Bashiqa may now escalate anew, with both sides sliding into a much more severe crisis than Baghdad and Ankara experienced in 2016. One must remember that the Iran-led Popular Mobilization Forces during that crisis designated Turkish forces in Iraq a legitimate target. If Turkey fails to convince the Iraqi central government to allow its military base to stay, Ankara’s conflict with Baghdad and Tehran will be ethnic and sectarian and, by extension, will have broader implications for Turkey’s image in the region. The Bashiqa military camp is an important asset in the Turkish strategy to prevent the PKK-PYD expansion. Iran may use Turkish concerns to extort further concessions in Syria, where Ankara is trying to hold its ground.Another sensitive issue that may aggravate relations between Turkey and Iran is the trajectory of development of Iraqi identity. While Turkey has been defending an all-inclusive political nationalism in Iraq, with Sunnis, Shi’ites, Turkmen, Kurds and Arabs having distinct constitutional guarantees and mechanisms to address their concerns, Iran seems to be pushing a model of state government that consolidates power around the Shi’ite identity. With the Kurds after the defeat at Kirkuk drifting toward ethnic nationalism and the Sunnis having been marginalized for decades, Ankara doesn’t have reliable allies to resist Tehran’s encroachment in Iraq.Looking at the situation within a broader picture, one can see that Turkey is trying to rebalance relations with Iran with efforts to improve economic ties and calibrate steps on related security issues. But Iran is driven by regional ambitions and Turkey is now seeking alternative channels to influence Iranian policies in the region. The Astana talks may be an example of such an attempt.However, with souring relations with the West and rapid changes in its strategic environment Turkey may have realized that it is now in a much less favorable position vis-à-vis Iran.It is hard to understand why Turkey was so pleased to see the Kurds, Ankara’s allies in many crucial issues, losing ground while witnessing the rising influence of Iran, with whom Ankara may have much more difficult relations. A possible reason may be the ongoing disintegration of strategic planning in Turkey. Uncertainty regarding the current government’s political future, Turkish political processes and the profound changes in Turkey’s bureaucratic institutions, together with the absence of a clear US strategy in the Middle East, especially toward Iran, may well have contributed to Ankara’s failing capacity to perceive the unfolding reality in the region clearly.The author is an Ankara-based freelance journalist writing about politics and society in Turkey.