Syria has been one of the hot topics of Turkish political debate this summer. After having announced a new military operation in northern Syria, Turkish President Recep Tayyip Erdoğan could not get his Russian and Iranian counterparts to agree to his plan at successive international summits. The Turkish military opted instead to intensify its drone and missile strikes in the region, where the last few months have turned out to be some of the bloodiest in recent years.

In August, the first anniversary of a violent riot against a Syrian community in Ankara was another reminder of the surge of anti-refugee sentiments in Turkey this past year. Most recently, statements by Erdoğan and Turkish Foreign Minister Mevlut Çavuşoğlu seem to have paved the way for Turkey’s rapprochement with Syrian President Bashar al-Assad, after years of acrimony.

Just a few years ago, the Turkish president was referring to Assad as a “terrorist who has killed close to a million of his citizens.” On August 19, the same Erdoğan declared that “Turkey does not have a problem with defeating or not defeating Assad,” before adding that “there is no resentment in politics.”

This U-turn in Ankara’s attitude toward the Damascus regime, however, does not contradict the tenets of Turkey’s Syria policy. It indicates that the Turkish leadership is ready to work with the Syrian regime to address Turkey’s objectives in Syria, which remain counterterrorism and border security, not regime change.

Guided by these priorities, the Turkish government has ordered four military operations in Syrian territory since August 2016, has made plans for a fifth one, and has consistently used its activism in Syria to reach out to its nationalist base, rally the country around the flag, and ultimately improve its electoral chances. At a time when Turkey is months away from the next general election, Ankara calculates that it can reap domestic benefits from making an opening to the Syrian president. The Turkish leadership has three good reasons to think so.

First, by explicitly showing a willingness to engage with Assad the Turkish government is stealing one of the opposition’s talking points. Leaders of the Republican People’s Party and the Good Party have declared that rekindling relations with Assad would be one of their first steps if they were to be in a position of power, and the six-party opposition coalition is discussing whether dialogue with Damascus should be included in their electoral manifesto.

A more positive relationship with the Syrian president would allegedly accelerate the repatriation of the almost 4 million Syrians refugees who currently live in Turkey, which is a key electoral promise at a time when resentment against refugees is being exacerbated by the nation’s economic crisis.

Second, while it remains unclear whether better ties with Damascus will prompt Syrians to return home, negotiating with Assad is one of the few initiatives the Turkish government can take to persuade the electorate that it is trying to resolve the refugee crisis. Other measures, such as building briquette house camps in the areas of northern Syria under Turkish control, have not proven decisive so far.

Third, opening channels of dialogue with the Syrian regime would give prominence to the Kurdish question in the Turkish political debate—something that Erdoğan calculates will play to his advantage. Ankara and Damascus share an interest in putting an end to the partial independence of the Autonomous Administration of North and East Syria, which the Kurds call Rojava, a region controlled by the Syrian Democratic Forces (SDF). This group is dominated by the Kurdish People’s Protection Units (YPG). Turkey regards the YPG as an extension of the Kurdistan Workers’ Party (PKK), which Ankara considers a terrorist organization. Taking a hard stance on the Syrian Kurds would galvanize Erdoğan’s nationalist electorate, complicating the opposition’s plans to reach out to Turkish Kurds, a key constituency to defeat the ruling Justice and Development Party at the ballot box.

Yet, beyond the headlines and the rhetoric of the Turkish government, the fundamentals of the Syrian crisis are here to stay. Any negotiation between Ankara and Damascus will stumble on the question of who rules northern Syria. Changes to the present status quo would require Turkey to renounce the areas it presently controls, the Syrian regime to take over the SDF-controlled territories in the northeast, and the two governments to reach a new security settlement for the Turkish-Syrian border. Such an agreement would probably be inspired by the Adana Agreement of 1998, which forced Damascus to end its support for the PKK.

There are other obstacles on the road to an Erdoğan-Assad grand bargain. These include difficult negotiations over the guarantees for the safe return of refugees. They also include discussion of the fate of the armed Syrian opposition that is backed by Turkey. And, in general, negotiations will also have to address the broad outlines of a new Syrian constitutional order.

The recent openings to Assad are significant also because they mark a further step toward Turkey’s return to a less bellicose foreign policy. This change of tack has been visible on several fronts in the past year, as Turkey has mended ties with Israel, Saudi Arabia, and the United Arab Emirates. The UAE, whose crucial economic and financial support Turkey secured last February, has been leading the front of Arab countries calling for normalization with Damascus. This foreign policy course correction is coherent with Erdoğan’s aim to further Turkey’s security and economic interests in the Middle East in order to increase his chances of reelection.

Similarly, the opening to Assad is just the latest outcome of the continued balancing act between Turkey and Russia, which has become increasingly complex after the latter’s invasion of Ukraine. For Russia, the Turkish-Syrian dialogue will bring the benefit of diminishing the chances of an expanded Turkish military footprint in northern Syria while driving a wedge between Ankara and its Western allies, who oppose any reconciliation with the Syrian regime.

For Turkey, maintaining a working relationship with Russia brings considerable financial benefits that are crucial in the current economic situation. Ankara’s and Moscow’s shared and conflicting interests encompass financial, military, and energy deals as well as geopolitical settlements across Ukraine, the Caucasus, and the eastern Mediterranean. Ultimately, Turkey’s game is to balance its position so as to maximize the benefits at home. The Turkish government’s objective remains to improve its chances of political survival. With much at stake in an electoral year, Turkey’s Syria policy will continue to be dictated by electoral interests.