Iranian Foreign Minister Mohammad Javad Zarif was on Wednesday holding previously unannounced talks with President Recep Tayyip Erdogan in Ankara, the Turkish presidency said.
Zarif went into the talks at the headquarters of Erdogan's ruling party, as expectations grow of an offensive in the Idlib province of northwest Syria bordering Turkey by Tehran's ally President Bashar al-Assad.
Turkey has been keeping a wary eye on the possibility of the offensive, as it seeks to bring peace to Syria along with Iran and Assad's other main ally Russia.
Ankara has throughout the seven year civil war in Syria supported rebels seeking to oust Assad but has put differences aside to form a three way alliance with Tehran and Moscow.
Erdogan and his counterparts Hassan Rouhani of Iran and Russia's Vladimir Putin are due to meet for a third summit on Syria in Iran on September 7, Turkish reports have said.
But analysts say that Idlib, which is largely controlled by rebel groups, could test the alliance with Turkey, as Ankara warns a military solution could lead to catastrophe and a new influx of refugees across its borders.
Turkey has 12 observation posts staffed by its military inside Idlib aimed at monitoring a de-escalation zone and media reports have said it has sent concrete blocks over the border to reinforce them in case of an offensive.
But analysts also say that Turkey is keen to preserve the three-way alliance and may be prepared to support a more limited offensive against the most extreme factions in Idlib.
Russian Foreign Minister Sergei Lavrov on Wednesday called on the West not to stand in the way of an "anti-terror operation" in Syria's Idlib.
Lavrov also said that there is "full political understanding" between Russia and Turkey and said it was necessary to "disassociate the so-called moderate opposition from terrorists."