The bilateral meetings came before the start of the trilateral summit between leaders of Turkey, Russia, and Iran.
The closed-door meeting among Erdoğan and Rouhani at the Sadabad Palace lasted around 45 minutes.
Erdoğan was accompanied by Turkish Foreign Minister Mevlüt Çavuşoğlu, National Defense Minister Hulusi Akar, Treasury and Finance Minister Berat Albayrak, and Hakan Fidan, chief of the National Intelligence Organization (MIT) during the meeting.
After his meeting with Rouhani, Erdoğan and Putin also held a one-on-one meeting.
Before the meeting, Erdoğan said: "Today is a really important and meaningful day... We will hold an important meeting in Tehran following Sochi and Turkey."
The first tripartite summit was held in Russia's Black Sea resort of Sochi on Nov. 22 to discuss progress made in the Astana peace talks and changes in de-escalation zones across Syria.
The second trilateral meeting was hosted by Erdoğan in April in the Turkish capital Ankara.
During the trilateral meeting, Erdoğan, Rouhani, and Russia's Vladimir Putin will discuss joint efforts as part of the Astana process and political efforts for finding a lasting solution to the Syrian conflict.
Following the summit, the leaders will hold a joint news conference.