The two countries are at odds over Yemen. Ankara has accused Tehran of backing Shiite Huthi rebels there and, in turn, being charged with fuelling tensions in the region.
"We talked about Iraq, Syria, Palestine... We had a long discussion about Yemen. We both think war and bloodshed must stop in this area immediately and a complete ceasefire must be established and the strikes must stop" in Yemen, Iran's Hassan Rouhani said during a joint press conference broadcast by state television.
Iran, which supports the Shiite Huthi rebels in Yemen, has condemned air strikes by an Arab coalition led by Saudi Arabia and supported by Turkey.
Rouhani said he hoped the two countries, "with the help of other countries in the region, help there to be peace, stability, a broader government and dialogue" between Yemenis.
More From This Section
"We agree on the fact that instability, insecurity and war must cease throughout the region," he said.
Erdogan, a conservative Islamist, denounced at the end of March what he called Iran's will for "domination" in Yemen, calling on Tehran to "withdraw all its forces from Yemen, Syria and Iraq."
Iranian newspapers and conservatives for their part denounced Erdogan's "insult" and called for his visit to be cancelled.
Turkey and Iran are also opposed on Syria, with Tehran the main regional ally of President Bashar al-Assad and Ankara supporting the rebellion.
Several ministers accompanied Erdogan, who is also expected to meet Iran's supreme leader, Ayatollah Ali Khamenei during his one-day visit.
Despite the tensions, the neighbouring countries want to strengthen trade to 30 billion dollars (28 billion euros) in 2015.
Erdogan pointed out that the balance of trade was unfavourable to Turkey, since "Iran exports USD 10 billion and imports only USD 4 billion in Turkish products."