On July 23, Turkey finally joined the fight against the Islamic State (also known as ISIS), and it did so with much fanfare. It began with a series of air and artillery strikes to push back ISIS forces in Syria and seal what has been a porous southern border. The Turkish government also gave the United States access to its Incirlik and Diyarbakir airbases, opening them up to support combat missions, not just surveillance operations.

This was a major win for the Obama administration, which, for months, had been negotiating with a reluctant Turkey to get it to recognize the ISIS threat. U.S. officials are now hopeful that ISIS can be set back on its heels, since Ankara will be able to wage a more robust bombing campaign given its proximity to the conflict. The U.S.–Turkish agreement about the Incirlik and Diyarbakir airbases apparently also involved the establishment of a safe zone in northwest Syria just north of Aleppo, something the Turkish government has long demanded, although Washington has refused to commit to it. Turkish Foreign Minister Mevlut Cavusoglu has argued that a safe zone would naturally emerge after removing ISIS forces from that part of Syria.

Kurdish men pose for a picture in front of a Kurdistan Workers Party (PKK) flag, March 17, 2015. Umit Bektas / Reuters Yet all is not as it seems. Although Washington trumpeted the agreement as a potential game changer in the fight against ISIS, Ankara’s recent behavior suggests that its primary mission is to use the opportunity to simultaneously fight the Kurdistan Workers’ Party (PKK), a Kurdish separatist group that the government has been fighting for decades. The group, however, has also been on the frontlines battling ISIS.

As Washington celebrated Turkey’s new commitment, Ankara’s initial airstrikes last week targeted both ISIS and PKK positions, and, as some have noted, the United States has essentially enabled Turkey to cloak its primary objective—striking the PKK and its Syrian cousin, the People’s Protection Units (also known as the YPG)—in the general fight against ISIS. Turkey would also be able to ensure that U.S. strikes against ISIS positions do not benefit Kurdish fighters in the process by coordinating joint missions and moving Turkish troops into areas immediately following U.S. sorties. By conceding to Washington’s requests to do more against ISIS, Turkey is actually hoping to achieve its true goals, which are to prevent the autonomous Syrian Rojava canton currently controlled by the Syrian Kurdish Democratic Union Party (PYD) from turning into a truly independent Kurdish state and use the Kurdish issue to bolster its political standing at home.

A Turkish F-16 fighter jet takes off from Turkey's Incirlik airbase, July 27, 2015. Turkey has been attacking Kurdish insurgent camps in Iraq. Murad Sezer / Reuters Turkey has also targeted its own Kurdish population through heightened policing after the July 20 terrorist bombing in the border town of Suruc. Linked to ISIS, the attack was directed at pro-Kurdish activists and left 23 dead. Since then, Turkey has been conducting an anti-terror sweep that as of July 29 has resulted in the arrest of 137 suspected ISIS sympathizers and 847 suspected PKK members. Writing in the pro-government paper, Daily Sabah, the influential presidential foreign policy adviser Ibrahim Kalin explicitly linked ISIS and the PKK. He essentially argued that the PKK and ISIS are two sides of the same coin because both groups use terrorism to achieve their political goals, and that PKK attacks are just as big a threat to Turkey as those carried out by ISIS.

Fighting the PKK and thwarting Kurdish ambitions in Syria are not the only dynamics driving Turkish actions. In addition to all of this, the ruling Justice and Development Party (AKP), which is head of the current caretaker government that will rule the country until a new coalition is formed (or, if one fails to form, until new elections are held in the fall), is attempting to reverse the political consequences of its Kurdish Opening policy, which granted Turkish Kurds greater rights in using the Kurdish language and expressing their Kurdish culture. It brought momentary peace, but appears now to have weakened the AKP’s hold on power.

Initiated by then Prime Minister Recep Tayyip Erdogan in 2009, the Kurdish Opening eventually led to the 2012 Kurdish–Turkish peace process with the imprisoned PKK leader Abdullah Ocalan. Those negotiations resulted in a ceasefire with the PKK in April 2013, one that has now been eviscerated in the wake of PKK attacks on Turkish soldiers and Turkey’s recent military strikes against PKK strongholds in northern Iraq.

Aside from bringing much-needed quiet following decades of terrorism and assassinations by the PKK, as well as the constant military operations to fight them, the AKP used the peace process to bolster its political standing. Given its more liberal stance on Kurdish issues, the AKP was the only parliamentary political party that was competitive in Turkey’s southeast. By appealing to the Kurds, the AKP assumed that it would reap even greater electoral rewards in the future, and in the process, cement itself as Turkey’s ruling party for a generation.

Protesters hold portraits of jailed Kurdish rebel leader Abdullah Ocalan and a Kurdish flag in Diyarbakir, Turkey, June 26, 2015. Sertac Kayar / Reuters The recent June 7 parliamentary election turned that logic on its head. The AKP had already been losing popularity among the Kurds, who faulted Ankara for endangering Kurdish fighters in Syria that were fighting ISIS by blocking reinforcements and supplies from reaching them across the border. This anger reached a boiling point during the fall 2014 siege of Kobani, a Syrian border town, during which Turkish armed forces stood by and watched ISIS gain ground. It was only U.S. airstrikes that enabled the YPG to successfully push out ISIS. In fact, many Turkish Kurds believe that Turkey has actively aided—and even created—ISIS in an effort to stamp out Kurdish nationalism.

When Kurdish political parties reorganized and consolidated as the People’s Democratic Party (HDP) in 2014 and announced that the HDP would compete in parliamentary elections, the AKP perceived the move as a new threat to its parliamentary dominance. It spent much of the campaign season railing against the HDP and its links to the PKK, and vilifying HDP leader Selahattin Demirtas. It turns out that the AKP’s fears were not unfounded, as the HDP outperformed expectations and garnered 13 percent of the vote on June 7, pushing the AKP below a majority of the seats in the Grand National Assembly for the first time in the party’s 13 years of single-party rule.

The government’s current military campaign against the PKK must be seen within the context of June’s election, and its timing is no coincidence. The strikes ostensibly focused on rolling back ISIS, but are being primarily directed at the PKK and come hand-in-hand with a political effort to roll back the HDP. Erdogan, who initiated the Kurdish peace process, has accused the HDP of being little more than a thinly veiled political arm of the PKK and slammed the HDP for expressing regret rather than condemnation after recent PKK terror attacks. It is all part of his effort to link the HDP with the PKK in the minds of Turkish voters.

On the political front, the AKP has begun proceedings to strip Demirtas of his parliamentary immunity from prosecution, and submitted a criminal complaint against the HDP that has led to a judicial investigation into the party’s ties to the PKK. That could lead to the shuttering of the party. This all-out assault against the Kurdish political party is in anticipation of new elections in the fall, which Erdogan will call if the current caretaker government is unable to form a coalition this month, a scenario that appears more likely with each passing day. If the HDP is significantly weakened or even removed from the scene entirely by then, the AKP’s path back to an outright majority will be significantly smoother. Whereas the AKP used to view a liberal approach toward Turkey’s Kurds as the key to its political dominance, the Kurds’ boost in power from the Syrian civil war and the success of Syrian Kurdish militias has pushed the AKP to take a hardline approach in order to improve its political standing.

Few will object to the AKP’s efforts to deal the PKK a fatal blow, particularly following the resumption of Kurdish attacks on Turkish police and military targets. From a political standpoint, the military campaign will be popular with Turkish nationalists and will reassure average Turks that a vote for the AKP is a vote for security and the resumption of law and order. The moves against the HDP, however, are being folded into this military campaign despite being a purely political maneuver. While Turkey loudly touts its intention to fight against terrorist groups of any and every persuasion, it is using this fight as a cover to carry out a parallel political battle that will remake Turkish politics and reestablish the AKP’s own political dominance.