The struggle between the ruling center-right Justice and Development Party in Turkey and the far-left Kurdish guerrilla movement, the PKK, had entered into a relatively quiet period in March 2013, when a peace process was begun. That peace process is now in tatters, as PKK fighters have in recent weeks repeatedly targeted Turkish police, soldiers, and even a gas pipeline, and Prime Minister Ahmet Davutoglu has replied with air strikes on the terrorist group’s redoubts over the border in Iraq. Observers have struggled to understand how things came to this pass, but few are in doubt that internal Turkish politics is behind these dramatic developments.

So too is regional politics around the rise of Daesh (ISIS, ISIL) in Syria and Iraq. The Turkish air campaign against the PKK bases in Iraq came at the same time that its air force flew a few missions for the first time against Daesh on the Syrian border with Turkey. Ankara also abruptly offered the United States the use of Incirlik Air Force base for air and drone strikes on Daesh in Syria. Erdogan was clearly attempting to trade an increased Turkish participation in the struggle against the radical Muslim terrorist organization for an abandonment by Washington of its new friends in the Kurdish guerrilla movement.

These developments are particularly disturbing to the pro–Kurdish Peoples’ Democratic Party (HDP), co-chaired by the left-feminist Figen Yüksekdag and the leftist activist Selahattin Demirtas. Kurds comprise about 20 percent of Turkey’s 75 million people and predominate in the hardscrabble southeast of the country. This weekend, Demirtas, a member of parliament, tried to mediate the conflict. “The PKK has to immediately silence their arms and remove their hands from the trigger,” he said. He also called on the Turkish government to initiate a reciprocal ceasefire.

At the same time, however, Demirtas warned that President Recep Tayyip Erdogan of Justice and Development (AKP) is trying to find a pretext to outlaw the HDP, which holds 13 percent of the seats in parliament after June’s election. Erdogan has indeed called for prosecution of HDP members viewed as too close to the PKK guerrillas, though he denies wanting to close down the entire party. Others, though, including the leader of the far-right Nationalist Movement Party (MHP), Devlet Bahceli, which has 16 percent of seats, have demanded that the Peoples’ Democratic Party be shuttered.

One major explanation for the breakdown in the Turkish-Kurdish peace process lies in the country’s recent parliamentary elections. The AKP, a party tinged with the religious right, had captured the presidency for Erdogan last year. He was hoping for a simple parliamentary majority that would allow his party to form a government without needing a coalition party, and would then permit it to change the Turkish Constitution so as to make the country a presidential system, more like that of France (or more sinisterly, Egypt). The AKP had been doing very well in elections for over a decade and its officials had reason to expect another victory.

Instead, in June the AKP came in with only 41 percent of the seats. It lost votes in two directions, to the far-right Nationalist Movement Party of Bahceli and to the pro–Kurdish HDP, especially to the latter. Many religiously and culturally conservative Kurds used to vote for Erdogan and his party, but in this summer’s general election they preferred the HDP. Kurds had not previously been allowed to have formal party representation of their own, but had often had several dozen independents in the Turkish legislature. The HDP insistence that it is multi-ethnic and multicultural had helped its acceptance, allowing it to attract some Turkish socialist, feminist, and LGBT voters.

At the same time that the HDP rose to block Erdogan politically, Ankara had watched a very disturbing development in neighboring Syria and Iraq. The Obama administration’s search for allies against Daesh (ISIS, ISIL) had led it to ally with various Kurdish groups, including the PKK in its Iraq hideouts and the PKK’s Syrian counterpart, the Democratic Union Party (PYD). Kurdish guerrillas turned out to have the best track record in taking on and defeating the minions of the faux caliphate. This development reversed the long-term Turkish success in having the United States agree with Ankara that the separatist PKK is a terrorist organization and taboo. (Washington had never, however, so designated the main Syrian Kurdish guerrilla group, the People’s Protection Units or YPG, the paramilitary of the Democratic Union Party.)

Not only were the Syrian and Iraq-based Kurdish guerrillas taking the fight effectively to Daesh, but Turkey was seen by its allies in NATO as peculiarly reluctant to join in that fight. Turkey’s Justice and Development Party wants to see the authoritarian and genocidal government of Bashar al-Assad in Syria fall. At the least, it turned a blind eye to the predations of Daesh, and there are allegations that Ankara gave at least some support to the radical organization. Moreover, since the right wing of the ruling AKP shades off into Muslim fundamentalists, it may have worried about alienating that section of the party by being seen to attack Muslim holy warriors. The result was that Turkey, a member of NATO, was less central to American Middle East policy this spring and early summer than were ragtag leftist Kurdish guerrillas. Ankara chafed.

Astute Turkish journalist Deniz Zeyrek argues that the PKK guerrillas in the mountains of Iraq on the Turkish border were themselves a little worried about the rise of Yüksekdag and Demirtas’s Peoples’ Democratic Party as a parliamentary force. The guerrillas, more militant, worried that the HDP would be co-opted by the Turkish establishment and harm the struggle for a Kurdish province or canton in the southeast in a federal Turkey (what the PKK now says it aims for). A power struggle has thus been going on for the soul of the Kurdish left, with the HDP arguing for civil politics in the framework of a united Turkey, while the PKK still hoped for a situation at the least more like that of Quebec in Canada, if not full independence for a Kurdistan that would rip from Turkey its eastern reaches. The PKK became more aggressive in its attacks on Turkish security personnel this summer, perhaps in part to grab back the spotlight.

At the same time, the HDP’s Demirtas came into stark conflict with President Erdogan in March over the issue of moving to a strong presidential system. Previously, the HDP had been viewed favorably by Ankara as a conduit for talks with the PKK. After Demirtas’ March speech against the presidential system, the HDP’s envoy to the imprisoned PKK leader Abdullah Ocalan, held on an island off the Turkish coast, has not been allowed to visit him.

The military campaign against the PKK by Prime Minister Davutoglu and President Erdogan thus does a great deal of political work for the Justice and Development Party. It disrupts a budding Obama administration alliance with the PKK against Daesh, and it forces Washington to denounce the rural guerrillas, especially since it was predictable that they would attack Turkish security forces in response to the aerial strikes. Turkish troops are NATO troops, so Washington has to honor its alliance.

At the same time, the AKP is driving a wedge between the moderate Peoples’ Democratic Party and the more hard-line PKK, forcing Demirtas to denounce the guerrillas and so weakening the Kurdish front. In addition, the Justice and Development Party is attempting to use a new war on PKK terror as a way of (unfairly) tagging the rising HDP as implicated in terrorism and delegitimizing it for Turkish and culturally conservative Kurdish voters. Some Turkish politicians are speaking of dissolving the party entirely.

The leftist T24 internet newspaper warned that President Erdogan is hoping for a hung parliament and snap elections, given the failure so far of Prime Minister Davutoglu to form a parliamentary majority. If Erdogan’s party can win a majority in new polls this time, having marginalized the pro–Kurdish HDP, he might finally get his strong presidential system. Journalist Hasan Cemal argued that the tactic will backfire and the AKP will lose entirely its former base of support in the Kurdish regions. “Erdogan believes that with a war of blood and tears he can reverse his June 7 [defeat] through an early election. He is fooling himself and dragging Turkey into a sanguinary maelstrom.”