The angry exchanges come at a time when Ankara and Tehran — co-sponsors with Russia of the “Astana process” — are ostensibly working to consolidate the cease-fire in Syria to facilitate a negotiated settlement. They also come just days before a new round of peace talks are due to be held in Geneva under UN auspices.

Turkish Foreign Minister Mevlut Cavusoglu followed up on Erdogan’s remark by accusing Iran of pursuing not just nationalist but also sectarian aims in the region.

That is what we see happening now after the latent animosity toward Iran in Turkey surfaced unexpectedly and at the highest level, when President Recep Tayyip Erdogan accused Tehran recently of pursuing “Persian nationalism” in Syria and Iraq.

It is hardly a secret that Turkey and Iran are regional rivals along the Sunni-Shiite divide in the Middle East, which only deepened with the failed Arab Spring. Yet rarely has the animosity spilled over into open and bitter verbal sparring.

Erdogan singled out Iran while answering questions after his address at the International Peace Institute in Bahrain Feb. 13, during which he outlined Turkey’s vision for peace in the Middle East.

“There are those who are working to divide Iraq. There is a sectarian and ethnic struggle there because of the question of Persian nationalism,” Erdogan said, indicating that this had to be prevented.

“We also have to prevent this in Syria and do what is necessary together with the Gulf [states], because we cannot just sit back — and will not sit back — in the face of oppression,” he added.

Erdogan made these remarks during his tour of the Gulf region, which included Bahrain, Saudi Arabia and Qatar — a point clearly not lost on Tehran given its tense ties with these states.

Iran’s Foreign Ministry spokesman Bahram Qassemi accused Erdogan of sensationalism and surrendering to his emotions, and maintained that Iran’s only concern was to secure regional stability and security.

“Supporting terrorist groups … using them as a tool, and failing to respect the national sovereignty and territorial integrity of neighboring countries have caused concern and prolonged instability in the region,” Qassemi said, indirectly accusing Turkey of undermining stability and security in Syria.

He was referring to Ankara’s support for anti-regime forces in Syria.

Turkish Foreign Minister Cavusoglu maintained Turkey’s frontal attack on Iran during his address to the recent security conference in Munich, Germany. Declaring that “Turkey is against all forms of religious and sectarian discrimination,” Cavusoglu said, “Iran is trying to turn Syria and Iraq into two Shiite states” and indicated that this was a very dangerous policy.

“This has to be stopped. Security and stability in the region can only be secured then,” Cavusoglu said.

Not surprisingly, these remarks elicited more harsh words from Qassemi, while Turkey’s ambassador to Tehran was summoned to the Foreign Ministry to receive a formal protest.

“Those who have carried out meddlesome, illegal and illegitimate measures, supported terrorist groups, and caused bloodshed and escalation of tensions and instability in the region cannot evade liability for such moves by playing a blame game,” Qassemi said.

Responding in similar fashion, Turkish Foreign Ministry spokesman Huseyin Muftuoglu said, “What is expected from Iran is to take constructive steps and review its regional policies rather than accusing countries that solely express their criticisms of these policies.”

Muftuoglu said Iran’s claims to be pursing constructive regional policies were belied by “concerns and complaints expressed intensively about this country at international platforms such as the United Nations and the Organisation of Islamic Cooperation.”

Despite their regional rivalry, which goes back centuries, Turkey and Iran have generally tried to avoid such exchanges in the past — even at times when they were seriously at odds over issues relating to the Middle East.

Turkish and Iranian attempts to turn the Syrian and Iraqi crises to their advantage seem to have changed that. Looked at from the Turkish perspective, Iran is one of the key players that obstructed its ambitions in the Middle East.

At the start of the Arab Spring, Turkey hoped to be a principal determinant with regard to the future of the region, in line with former Prime Minister Ahmet Davutoglu’s overly ambitious plans. These plans have largely been abandoned in the face of regional realities that were never factored in properly by Ankara, much to its detriment.

Turkey’s much more modest aim today is to contain developments that have evolved to its disadvantage, rather than trying to be a key player that charts the future of the Middle East. Meanwhile, Iran has become the target of Ankara’s ire for blocking Turkey’s regional ambitions.

Ilnur Cevik, a foreign policy adviser to Erdogan, reveals the anger and current thinking on Iran.

“Isn't Iran behind the Shiite militants in Yemen? Aren't the Iranian militants hurling missiles at a Saudi warship and even Riyadh from Yemen? … Isn't Iran knee-deep in Syria helping the Assad regime?” Cevik said in an article for the pro-government daily Sabah.

The Islamist media in Turkey does not hold back from reflecting the deep animosity felt for Iran, even though it strongly backed this country against the West before the Arab Spring. One of the most anti-Iranian (and anti-Western) journalists in this context is Ibrahim Karagul, the editor-in-chief of the Islamist daily Yeni Safak.

Karagul accuses Iran of having “imperial dreams” and claims it is “providing the environment for an Islamic civil war.” He also accuses Iran of using underhanded methods to block Turkey’s path in the region. “Iran has hit Saudi Arabia from Yemen and Turkey from Syria,” Karagul argued in his column.

Erdogan's call for a united front against "Persian nationalism" comes at a time when Washington is also upping the pressure on Tehran. This has led to speculation about a US-supported “Sunni bloc” — led by Turkey and Saudi Arabia — aimed at containing Iranian expansionism.

Turkey’s current flirting with the Donald Trump administration is also seen as a further sign that it is seeking to overcome differences with Washington in order to countervail, not just Russian plans for the future of the region, but also to roll back Iranian influence in Iraq and Syria.

Retired Ambassador Uluc Ozulker, however, counsels caution in Turkey’s dealings with Iran and Russia. He believes that moving in Washington’s slipstream in order to strengthen Turkey’s hand against Iran would be a serious mistake for Ankara.

“Without Iran and Russia, it will not be possible to secure peace and stability along Turkey’s border,” Ozulker told Al-Monitor. “Turkey has to find the right balance between Washington, Moscow and Tehran.”

Ozulker also recalled that although Tehran’s sectarian ambitions in the region have been more than apparent since the Iranian revolution, Turkey nevertheless chose to tread carefully in the past in its dealings with this neighboring country for a host of objective economic and political reasons.

“Ankara’s accusation that Iran is pursuing sectarian policies reveals that Ankara is also acting on the basis of sectarian considerations,” Ozulker added, pointing out that this was also a dangerous line to follow.