The foreign ministers of Turkey and Iran have pledged greater cooperation on resolving the Syria crisis, vowing to keep the dialogue open despite their differences.

At a joint news conference on Friday in Ankara, Turkish Foreign Minister Mevlut Cavusoglu and his Iranian counterpart, Mohammad Javad Zarif, said the two neighbouring nations have agreed to "keep closer contact" on the issue of the "territorial integrity of Syria".

Iran and Turkey have held opposing positions on Syria, with Iran backing the government of Syrian President Bashar al-Assad and Turkey advocating his departure.

Despite the differences, Turkey and Iran will "strengthen cooperation for a lasting peace in Syria", Cavusoglu said.

Zarif also said that Iran was "ready to work and cooperate" with Turkey and Russia on the issue of Syria, adding that it welcomed "the new cooperation that has started" between Moscow and Ankara.

"We believe all sides should work together to return tranquility and calm to the region and fight extremism in Syria," he said.

Zarif added that their differences "can be resolved through dialogue".

The Iranian official also expressed support to Turkey over last month's failed coup attempt, praising the Turkish people for defying the "overthrow and use of force".

"We believe that the era of bullying and coups is over and [these things] no longer have a place in our region. People’s choice cannot be suppressed by a military group," he was quoted by PressTV as saying.

Zarif's visit was the first meeting between top Iranian and Turkish officials since the July 15 failed coup attempt.

Turkey has complained about a lack of support from its Western allies over the attempted coup.

Al Jazeera's Zeina Khodr, reporting from Ankara, said that some were "analysing this meeting and rapprochement ... as a message to the West, as some sort of political leverage", after the coup attempt.

Despite the meeting, however, Khodr said that there was still "no common ground" on Syria, and that there were still "deep disagreements" on how to resolve the civil war.

Zarif is also expected to meet with Turkish President Recept Tayyip Erdogan, according to the Turkish foreign ministry.