DUBAI (Reuters) - Iranian President Hassan Rouhani called on Saturday for greater cooperation between regional rivals Iran and Turkey to help establish stability in Syria and Iraq.

"Today when the region is in a critical condition, cooperation and consultation by Tehran and Ankara in resolving issues can make a difference," Rouhani told visiting Turkish Foreign Minister Mevlut Cavusoglu, Iran's state news agency IRNA reported.

"If major regional powers stand together, problems in Iraq and Syria will be resolved without the need for foreign powers," Rouhani added.

"Despite (their differences), the two countries' officials are looking for solutions and seeking to draw closer their points of views, especially on Iraq and Syria," IRNA earlier reported.

"Preserving the territorial integrity and national unity of Iraq and Syria is in the interest of Iran and Turkey as well as that of regional peace and stability," Cavusoglu was quoted by IRNA as saying.

Iran, a Shi'ite Muslim nation, is a main ally of President Bashar al-Assad in Syria's civil war, while Sunni-majority Turkey has been one of his fiercest critics and has supported his opponents.

Iran has joined Iraq in criticizing the Turkish military presence in northern Iraq, which Ankara has said is at the invitation of a Kurdish regional government.

Relations between the two neighbors appear to have improved after Iran supported the government of Turkey against a failed military coup in July.

(Reporting by Dubai Newsroom; Editing by Alexander Smith and Hugh Lawson)