Supporters of the Pro-Kurdish Peoples’ Democratic Party at a rally in Diyarbakir, Turkey, on Sept. 17. (Sertac Kayar/Reuters)

Aykan Erdemir, a former member of the Turkish Parliament, is a senior fellow at the Foundation for Defense of Democracies. Merve Tahiroglu is a research associate at the Foundation for Defense of Democracies.

Iraq’s Kurds are preparing to hold their referendum on independence on Sept. 25, and in Turkey anxieties are high. Ankara, headed by the iron-fisted President Recep Tayyip Erdogan, officially opposes the plebiscite. The Turkish government has long feared Kurdish independence outside its borders lest it provoke similar aspirations within them. Turkey has come a long way toward accepting Kurdish identity, thanks in part to Erdogan’s efforts, but has recently receded back into anti-Kurdish bigotry, also thanks to Erdogan’s machinations. As a result, Turkish reactions to the vote betray a paradoxical mixture of pragmatism and fury.

The Kurds are spread across the north of Iraq and its three neighboring states — Turkey, Syria and Iran. Turkey is home to more than 15 million Kurds, the largest of the four communities, and views Kurdish secession as the leading threat to its national security. Ankara historically dealt with this perceived threat by denying its Kurdish citizens even the most basic expressions of ethnic identity, including periodic bans on Kurdish language and names, employing instead a strategy of repression and assimilation. Tensions reached their apex in the 1980s, when Kurdish militants under the banner of the Kurdistan Workers’ Party (PKK) launched a violent campaign against the Turkish state.

Over the decades, Turkish politicians across the political spectrum exploited the conflict and fueled nationalist sentiments to shore up votes from an anxiety-ridden electorate. Today, Turkey’s Kurdish anxieties are complicated even further by a bizarre tactical alliance between Erdogan’s ruling Justice and Development Party (AKP) and its ultranationalist partners in government — strange bedfellows that once advocated diametrically opposite views on the Kurdish issue.

Just five years ago, Erdogan’s Islamists drew the ultranationalists’ fury by launching direct negotiations with the outlawed PKK, a taboo in Turkish politics. Erdogan also forged close economic ties with the Kurdistan Regional Government (KRG) in Iraq, defying the prevalent prejudice and hostility towards Iraqi Kurds. He even invited KRG President Masoud Barzani to Turkey, where the Kurdish leader delivered a historic speech under Turkish and KRG flags. This was a bold step in a country that for years dismissed Barzani and his colleagues as primitive clansmen.

All that changed in June 2015, when the AKP lost its majority in parliament after a predominantly Kurdish party passed the country’s 10 percent electoral threshold for the first time in history. Desperate to regain power, Erdogan turned to the ultranationalists, dramatically reversing his Kurdish opening: The war with the PKK resumed with a vengeance that summer, and Ankara became one of the loudest opponents of Barzani’s referendum this fall. Dozens of duly elected Kurdish politicians now sit in jail on dubious charges.

Erdogan’s sharp turns on the Kurdish issue — first by legitimizing the outlawed PKK and then by jailing Kurdish lawmakers en masse — have produced a disjointed policy and disoriented electorate. In February, Erdogan again raised the Kurdish flag in honor of Barzani’s visit to Turkey, while scolding the Iraqi Kurds in April to lower it in Kirkuk, controlled by the Iraqi Kurds since 2014.

In the past decade, the Turkish president has advanced a paradigm of “good” vs. “bad” Kurds to justify his relationships with Barzani and the PKK to an electorate wary of both. While Erdogan has no sympathy for the PKK, he is willing to embrace Kurds as long as they remain loyal to himself or to his KRG partner Barzani. During the peace talks, Erdogan even applied that paradigm to the PKK itself, distinguishing the group’s military command from its jailed leader Abdullah Ocalan, with whom his government negotiated.

This selective treatment of Kurds is ultimately perilous, for it anchors Turkish support for Barzani on the whims of Erdogan, and on the KRG’s status as a region beleaguered by hostile actors and dependent on Ankara for foreign trade — effectively a Turkish vassal state. Thus for many Turks, the KRG is only palatable so long as it identifies with “good” Kurds, as defined by Erdogan. Even then, Turks have never been able to utter the word Kurdistan, a remnant of decades of blanket denial of the Kurds’ existence as a distinct ethnicity. To make matters worse, Turkey’s Islamo-nationalist ruling bloc recently submitted a resolution to ban the use of the word “Kurdistan” in parliament, introducing a fine equivalent to one-third of a lawmaker’s monthly salary.

In Turkey’s current state of rampant nationalism and heightened Kurdish anxieties, prospects for genuinely warm relations between Turks and a nascent Kurdistan remain elusive. Erdogan will continue to ride the anti-Kurdish sentiment at home together with his far-right allies, while also benefiting from energy and economic cooperation with the KRG. Thus, a pragmatic partnership between Erdogan and Barzani may continue beyond the referendum, contingent — as with all the Turkish president’s relationships — on the Iraqi Kurds’ willingness to play along with Erdogan’s two-faced game.