Turkey and Iran said on Friday they had common concerns about the increasingly sectarian nature of Syria's civil war, signalling a thaw in a key Middle Eastern relationship strained by stark differences over the conflict.
Iran has been a staunch ally of Syrian President Bashar al-Assad since the start of the 32-month-old uprising against him, while Turkey has been one of his fiercest critics, supporting the opposition and giving refuge to rebel fighters.
But the election in June of President Hassan Rouhani, a relative moderate who says he wants to thaw Iran's icy relations with the West, and shared concern over the rise of al-Qaida in Syria, have spurred hopes of a rapprochement.
"Sitting here together with the Iranian foreign minister you can be sure we will be working together to fight these types of scenarios which aim to see a sectarian conflict,'' Turkish Foreign Minister Ahmet Davutoglu told a conference in Istanbul.
Iranian Foreign Minister Mohammad Javad Zarif, who held talks with Turkish President Abdullah Gul in Istanbul and was due to meet Prime Minister Tayyip Erdogan later in Ankara, echoed the comments, saying that sectarian unrest posed an even greater risk than the use of chemical weapons.
"I believe sectarian conflict is even a greater threat and it is not confined to one region,'' Zarif said.
"If the flames of sectarianism rage in the Middle East, you will see the results in the streets of London, New York, Rome and Madrid,'' he told the conference.
While deep divisions remain between Ankara and Tehran over the conflict in Syria, particularly over the role of Assad in any transitional government, diplomats and government officials say both sides want to mend a relationship which could be key to wider diplomatic efforts towards a solution.
"Both Iran and Turkey are at a point where they think they can work together on Syria,'' a senior Turkish official said.
"Both countries believe the situation needs an urgent solution. But the big question is how,'' he told Reuters.
A long-delayed international peace conference in Geneva, first proposed in May, would be high on the agenda in Zarif's conversations with Erdogan, government sources said.
Arab and Western officials told Reuters this week that international powers were unlikely to meet their goal of convening the "Geneva 2'' talks later this month, largely due to differences over who will represent the opposition.
Turkey has long argued that Iran and Iraq, another neighbor with whom Ankara has been trying to mend fences, should be involved in the talks if they are to be credible.
Tehran's desire to participate in a June 2012 meeting on Syria hosted by the United Nations in Geneva was a major bone of contention between Washington and Moscow, Assad's key ally.
"For Geneva 2 to be meaningful there must be a clear political strategy and there must be Russia and Iran at the table. Both of them must be included and so must Iraq,'' a source close to the Turkish government said.
With al-Qaida-linked groups such as Jabhat al-Nusra and the Islamic State of Iraq and the Levant (ISIL) taking territory in parts of northern Syria near Turkey's border in recent weeks, pressure for a resolution has been mounting.
"Turkey and Iran's positions have moved closer, because I think Turkey also has realised the threat of these radical elements on its border,'' a regional diplomatic source said, speaking on condition of anonymity. "There are still disagreements, but I think these disagreements can and must be overcome because both Turkey and Iran are key to the stability of the region.''