Turkish-Iranian relations have always defied any general characterisation. The two neighbours have never had a straightforward alliance, feud, cooperation or rivalry. Instead, their relationship always carried all these elements simultaneously. There have been times in which the relationship has seemed to be tilting one way or another, and this has generated more debate, controversy and confusion about the nature and future course of the relations between the two countries.

We are now passing through such a period. Turkish-Iranian relations are now being seen as moving towards cooperation, if not alliance-building. Such a characterisation, however, is premature and is reading too much into diplomatic niceties.

In recent times, the diplomatic traffic between Ankara and Tehran seems to have intensified. As recently as August, a large Iranian military delegation headed by military chief of staff Mohammad Hossein Bagheri visited Ankara, meeting their military counterparts as well as President Recep Tayyip Erdogan. The latter is also expected to pay a visit to Tehran soon.

This recent uptick in diplomatic activity should be seen in the context of a recent convergence of concerns and threat perceptions in the Middle East. However, it should not be interpreted as anything more than that, as Turkey and Iran continue to have diverging, if not conflicting, interests, especially in Iraq and Syria.

Common concerns

A number of common concerns have recently emerged between Turkey and Iran, which has facilitated the recent thaw in relations. Two factors have been particularly important.

First of all, the struggle to establish a post-Arab Spring regional order has generated anxiety in both Ankara and Tehran. The most obvious manifestation of this struggle was on full display during the latest Gulf crisis. Neither Iran nor Turkey regarded this crisis as an isolated confrontation between Qatar and the Gulf-Arab coalition.

The Saudi-Emirati-Egyptian axis is trying to establish a new regional order supported by the Trump administration and Israel, and condoned by countries like Jordan. The logical other of this alliance is political Islam, and by extension Turkey, and the publicly announced enemy is Iran. Therefore, this new regional order, if imposed, would be detrimental to the interests of both regional powers.

Turkey and Iran both opposed the Saudi-led block's moves against Qatar. In fact, during the initial phase of the crisis, Iranian Foreign Minister Javad Zarif paid a rare visit to Turkey to discuss, among other issues, what was happening in the Gulf.

Two issues cause particular concern in Turkey and Iran: the perceived opacity of US policy and the political ambitions of the Kurds.

Secondly, the struggle for the post-Arab Spring regional order has coincided with another one to determine the post-ISIL futures of Iraq and Syria. The more territories the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) loses, the more rivalries emerge over who should control them.

Two issues cause particular concern in Turkey and Iran: the perceived opacity of US policy and the political ambitions of the Kurds. Iran is anxiously awaiting whether the US will switch its regional policy from ISIL-first to Iran-first policy in the near future. Turkey, on the other hand, is disturbed by the fact that it can't figure out the durability of US for the Kurds in Syria and the end goal of this partnership in Syria.

Both countries are also concerned about the overall aims of the US' Syria policy. The prospect of Kurdish statehood in Iraq and of autonomy in Syria and the potential spillover effect these could have on the Kurdish population in Turkey and Iran generate much anxiety in both capitals.

The emergence of the Syrian Kurdish bloc led by the Democratic Union Party (PYD) as a major player in Syria has pushed Turkey to re-evaluate its Syrian policy. It has prioritised pushing back against the gains of the Syrian Kurds over regime change in Syria and this new strategy has become the thorniest issue in Turkish-American relations.

INTERACTIVE: Major Kurdish Factions

The cooperation that emerged between the US and the PYD during the ISIL siege of the Syrian Kurdish town of Kobane between September 2014 and February 2015 acquired a much more solid grounding with the creation of the Syrian Democratic Forces (SDF), the backbone of which is the PYD's military wing, the People's Protection Units (YPG).

The PYD, which Turkey considers an affiliate of the Kurdistan Workers' Party (PKK) and a national threat, has expanded its territorial gains, received international recognition and legitimacy and acquired military equipment and skills as a result of this partnership. Ankara has perceived US' use of SDF as the primary force in the fight against ISIL even outside of the Kurdish-majority areas as evidence of Washington's long-term commitment to the Syrian Kurds. In a sense, for Turkey the de-ISIL-ification of these areas has turned into their SDF-ification or PYD-isation.

Iran, too, is concerned with Kurdish political ambitions, particularly those of the Iraqi Kurds. The independence of Iraqi Kurdistan would diminish the status of Iraq - a Shia-majority country over which Iran has a significant level of influence - in terms of population, geography, hydrocarbon wealth, and water resources. An independent Iraqi Kurdistan is also likely to be closer to the West, Turkey, Israel, and arguably Gulf states than to Iran.

Kurdish statehood could also create plenty of domestic trouble for Iran. The ties of the Iranian Kurdish population and parties with their Iraqi Kurdish brethren are more solid than those with Turkish Kurds. Aside from the PKK's Iranian affiliate the Kurdistan Free Life Party (PJAK - created in 2004), all other Iranian Kurdish parties have deep historical ties with the Iraqi Kurdish parties. In fact, the leadership of the Iranian Kurdish parties, Kurdistan Democratic Party of Iran (KDP-I) and the left-wing Komala, are residing in Iraqi Kurdistan.

Diverging interests

Yet these shared concerns don't translate into shared interests in Turkish-Iranian relations. Although both countries are worried about Kurdish statehood, Turkey's interests lie in minimising the PKK-PYD threat, while the political projections of Iraq's Kurdistan Democratic Party (KDP) are rather tolerable (even if Ankara opposes its latest push for independence, it is still much less of a threat than an autonomous pro-PKK body in northern Syria).

For Iran, it is the opposite: The break-off of Iraqi Kurdistan bodes ill for its policies in Iraq and it would do anything to prevent it; the PKK and PYD's presence in Syria and Iraq, however, is no more than a nuisance.

Turkey has been in alignment with the Kurdish conservative nationalist current, spearheaded by Massoud Barzani's KDP, whereas the Marxist-nationalist current led by the PKK has had working ties with Iran and its allies such as the Iraqi central government until recently.

This is why despite Iran's anxiety about PYD's expanding partnership with the US and territorial control, it still keeps its cold peace with the group. The reflection of this policy is that Iran and the PKK's Iranian offshoot PJAK have kept the ceasefire they concluded in 2011.

Apart from the Kurdish issue in Iraq, Iran and Turkey have other diverging interests. Ankara has been disturbed by the twin processes of the centralisation and sectarianisation of the Iraqi state. In principle, Ankara supports the strengthening of the central government in order to curb the irredentist aspirations of Iraqi Kurdistan, but this could mean the domination of sectarian politics as the Shia groups retain more state power - a trend already in place in the country's security architecture.

This process was in full force under the pro-Iranian premiership of Nouri al-Maliki between 2006 and 2014 and his policies were arguably largely supported by Iran. Tehran now also supports the Iraqi central government's sectarian policies and use of Shia militias in the areas that have been cleared from ISIL. This runs the risk of further aggravating Turkey's allies in Iraq - the Iraqi Sunnis and the KDP.

Ankara and Tehran have divergent interest in Syria as well. Although Turkey has stopped calling for regime change in Damascus, it is still not in a position to condone the total elimination of the opposition. Like the regime, Iran seems to favour inflicting as much destruction on the opposition as possible. At the same time, it is striving to convince Turkey to open channels with the regime, using the Syrian Kurdish territorial expansion as a pretext.

OPINION: Iran and the Russian-Saudi rapprochement

Putting aside principles or normative considerations, the complete elimination of the opposition or Turkey's opening towards the regime would bode ill for Turkish interests, as its ties to the opposition are one of the most important points of leverage (however fast it may be diminishing) it has in the Syrian negotiations.

Unless and until Turkey believes that it is establishing some balance of interests or influence vis-a-vis Iran in Iraq and Syria, any cooperation with its eastern neighbour will remain fraught with latent or overt tensions and grievances.

The US support for the Syrian Kurds is what is primarily motivating Turkey to seek closer relations with Iran as well as Russia. Any change in US policy towards the Syrian Kurds will have a direct impact on Ankara's relations with Tehran.

The fuel for Turkish-Iranian rapprochement was provided by their shared concerns. Nevertheless, the level at which they can cooperate remains conditional and constrained by their divergent interests in the region.

Galip Dalay is a senior associate fellow on Turkey and Kurdish Affairs at the Al Jazeera Centre for Studies, and research director at Al Sharq Forum.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.