The Islamic Republic’s ability to maintain friendly relations with Turkey while standing by its ally in Damascus will be severely tested as the world grows increasingly concerned about a potential new Middle Eastern war erupting between Syria and Turkey.

(LobeLog) A common view in Washington is that President Donald Trump’s decision to essentially green light Turkey’s Operation Peace Spring against the Peoples’ Protection Units (YPG) in northern Syria benefits key U.S. adversaries, including the Islamic Republic of Iran. Prominent members of the U.S. foreign policy establishment and writers in mainstream American media outlets keep making this argument.

Brett McGurk, the former special presidential envoy for the Global Coalition to Defeat ISIS, called Trump’s decision a “gift to Russia, Iran, and ISIS.” House Minority Leader Kevin McCarthy condemned Turkey’s Syria operation, maintaining that it could “give the likes of al-Qaeda and Iran new footholds in the region…” Wajahat Ali, a contributing op-ed writer at the New York Times, tweeted: “It’s a win for ISIS, Russia, Iran and Turkey.”

Yet such claims are too simplistic and misleading. Tehran’s interests in the Kurdish parts of northern Syria are complicated and the Iranian government officially and strongly opposes the Turkish incursion into northern Syria.

Shortly before Turkey launched Operation Peace Spring, Iranian Foreign Minister Mohammad Javad Zarif called on Ankara to have “respect for Syria’s territorial integrity and national sovereignty.” Two days later, the Iranian military began holding drills close to the Iranian-Turkish border, while Tehran was warning Ankara not to move ahead with its plans in northern Syria. According to the Iranian Students News Agency (ISNA), the drills entailed army helicopters, rapid reaction units, and mobile and offense brigades. Iranian army chief Major General Abdul Rahim Mousavi, who oversaw the drills, hailed their results as positive, stating that they were meant to “measure the readiness, mobility and speed” of Iranian forces near Turkey. Mousavi added: “The message to the enemies is that if they make the wrong calculations, they should know that the children of this land are ready to resist with their full power at any time and place.”

Iran’s parliamentary speaker, Ali Larijani, had a trip planned to the Turkish capital which he cancelled after Turkey launched its Syria operation. Iran’s Foreign Ministry called for an “immediate end to the attacks and for the withdrawal of Turkish forces from Syrian soil” after the Turkish assault began. The ministry also emphasized that while Tehran understands Ankara’s “security concerns,” Iran’s position is that Turkey’s “military action would not only not diminish that country’s security concerns, but also cause financial and humanitarian damages.”

Ultimately, Ankara’s military campaign leaves Tehran in a difficult situation. On one hand, Iran wants to see the Astana peace process (involving Iran, Russia, and Turkey) succeed in terms of resolving the Syrian crisis, particularly in Idlib, thus Tehran desires a continuation of good relations with Ankara. Similarly, Moscow doesn’t want its conflicts of interests with Turkey to upset the Astana process. On the other hand, as a supporter of the Syrian government, the Islamic Republic is deeply unsettled by the fact that Turkey’s Operation Peace Spring relies so heavily on anti-Assad rebel forces from northern and/or eastern Syria. Indeed, Iranian and Iranian-aligned forces have fought those rebels throughout the Syrian civil war.

Turkish-backed groups, including the Sultan Murad Division, Faylaq al-Sham, Ahrar al-Sharqiya, etc., which have fought the Assad regime under the umbrella of the Free Syrian Army (FSA)—now rebranded the Syrian National Army (SNA)—are central to Turkey’s Syria operation. Some of the 14,000 rebels in these groups entered Syria from Turkey with the Turkish military while others were already in Syria, near the towns where the Turks have targeted the YPG this month. These forces are on the frontlines doing much of the heavy lifting in the fight against Ankara’s Syrian Kurdish enemies and Turkey will count on them to guard towns taken from the YPG. Naturally, Iran does not want to see these Sunni groups—some of which previously received U.S. support—to gain new life in the Syrian war, which now appears to be happening because of the Turkish incursion.

On October 11, protests took place in Iranian Kurdistan one day before hundreds of Iranians gathered at Turkey’s embassy in Tehran to express their staunch opposition to Ankara’s military campaign. Such public displays of anger directed against Turkey underscore how domestic as well as regional/international politics are also impacting Tehran’s response to Operation Peace Spring.

Within the context of the Trump administration’s “maximum pressure” campaign against Iran, officials in Tehran have sought to improve the Islamic Republic’s relationship with Iranian Kurdish communities. Fearful of the U.S. military presence in the Gulf as well as Salafist-jihadist groups operating in Sistan and Baluchestan Province, allegedly with U.S. and Saudi support, the leadership in Tehran wants to prevent outside forces from exploiting opportunities to use militant Iranian Kurdish groups as proxies in any campaign to weaken Iran’s government. Doing so requires engaging Iranian Kurdish factions in a dialogue, which has been taking place in Norway since May, while also addressing socio-economic and political problems in northwestern Iran, which for many years have fueled Kurdish resentment toward the Iranian government.

Doubtless, with millions of Iranian citizens sympathizing with Syrian Kurds who are struggling to survive amid Turkey’s campaign, Iran has to contain such anger and not appear to be siding with Ankara in Operation Peace Spring. At the same time, Iran is Turkey’s neighbor and the two states have always maintained a relationship rooted in pragmatism even when Tehran and Ankara have not seen eye to eye on regional issues. As sanctions continue taking a severe toll on Iran’s economy, the Islamic Republic understands the importance of maintaining its friendship with Turkey.

Furthermore, Iran does not want to walk away from the progress that it has made in working with Turkey and Russia via the Astana process—however hampered that arrangement might be due to Operation Peace Spring. Tehran also shares Ankara’s interest in preventing the YPG from establishing a statelet in northern Syria that could provide Israel with a foothold near the Syrian-Iraqi border from where it could conduct more strikes against Iranian-backed actors in the region.

At this juncture, despite some silver linings that Tehran might see in Ankara’s assault on northern Syria, Iran is seeking to pressure Turkey into halting its military incursion while also pushing the YPG, Ankara, and Damascus toward a new understanding that can lead to stability and security along the Turkish-Syrian border. On October 12, Zarif offered to engage all three while referring to the Adana accord of 1998, which prevented a Turkish-Syrian war by requiring the Assad government to end its sponsorship of the Kurdistan Workers’ Party (PKK), as the basis for striking a deal that could lead to Turkey’s military and the Syrian Arab Army (SAA) guarding the Turkish-Syrian border through a coordinated effort. Nonetheless, with Erdogan vowing not to negotiate with “terrorists,” it is difficult to imagine Ankara and the YPG reaching any sort of peace in the foreseeable future.

Looking ahead, Tehran will not be shy about voicing its opposition to Turkey’s anti-YPG operation. The regional and domestic ramifications for Iran appear dangerous from Tehran’s perspective. Yet Iran is carefully considering Turkey’s legitimate security interests in the process while seeking to avoid any actions that could create major problems for bilateral affairs. The Islamic Republic’s ability to maintain friendly relations with Turkey while standing by its ally in Damascus will be severely tested as the world grows increasingly concerned about a potential new Middle Eastern war erupting between Syria and Turkey. Now that the YPG and the Syrian government have reached a deal to allow SAA forces to re-enter land territory in northeastern Syria that has been controlled by the YPG since 2012, it remains to be seen what will happen to Operation Spring Peace. Yet with Turkey voicing its determination to push its offensive deeper into Syria, officials in Tehran are nervous about the future of the Astana peace process.

Undoubtedly, such an outcome would be anything but a “gift” to Iran.