Diplomatic tensions have intensified between Turkey and Iran as the two countries traded accusations over their roles in the Syria conflict and the Middle East.

Iran summoned the Turkish ambassador in Tehran on Monday over comments made by Turkish Foreign Minister Mevlut Cavusoglu and President Tayyip Erdogan, accusing the Islamic Republic of destabilising the region.

Turkey and Iran have been regional rivals for centuries, but have sought to forge a pragmatic relationship in recent years, with Iran strongly supporting President Erdogan after last year's failed coup.

Turkey, a country with a Sunni majority, and Shia Iran have been on opposite sides of the conflict in Syria, with Ankara seeking to overthrow President Bashar al-Assad and Tehran being, along with Russia, his key backer.

Foreign Minister Mevlut Cavusoglu lashed out at Iran in a speech to the Munich Security Conference at the weekend, saying some of its actions had undermined security in the region and urging Tehran to promote stability.

"Iran wants to make Syria and Iraq Shia," he said, quoted by Turkish state media.

"Turkey is very much against any kind of division, religious or sectarian," he said.

Erdogan also accused Iran of promoting a "Persian nationalism" that had damaged the Middle East.

"There is Persian nationalism here, we have to prevent this. We cannot just watch this oppression," Erdogan said on a visit to Bahrain on February 14.

Iran's warning

The Iranian foreign ministry spokesman Bahram Ghassemi warned on Monday that Tehran's patience "had limits" after Tehran summoned the Turkish ambassador over Turkish remarks.

"We hope that such statements are not made again. If our Turkish friends continue with this attitude we will not remain silent," he added.

Turkey's foreign ministry spokesman Huseyin Muftuoglu hit back by saying it was "incomprehensible" to receive such accusations from Tehran, whom he charged with "not hesitating to push into warzones refugees sheltering from regional crises.

READ MORE: Russia, Turkey, Iran agree plan to support Syria truce

"Instead of accusing countries that have criticised Iran, it should take constructive steps and review its own regional policies."

The angry exchanges have come just after Erdogan returned from a week-long tour of the Arabian peninsula, including talks with the leadership of Iran's arch regional foe and Ankara's Sunni ally Saudi Arabia.

Harmony between Turkey and Iran is crucial in ensuring the preservation of a fragile ceasefire in Syria, which is also backed by Russia.

The ceasefire came into force at the end of last year as a basis for peace talks.