"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 President Hassan Rouhani said during a joint press conference broadcast by state television.
Turkey's President Recep Tayyip Erdogan made no remarks about Yemen, but he talked at length about bilateral relations with Iran.
Iran, which supports the 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" would contribute to "peace, stability, a broader government and dialogue" between Yemenis.
"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 Foreign Minister Mohammed Javad Zarif reacted by accusing Ankara of fuelling instability in the Middle East.
Iranian newspapers and conservatives for their part denounced Erdogan's "insult" and called for his visit to be cancelled.
Signup to our newsletter and follow us on Facebook and Twitter!
State news agency IRNA said Zarif is to travel to Oman on Wednesday and then Pakistan for talks on the Yemen conflict.
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 also met 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 $10 billion and imports only $4 billion in Turkish products."
And he asked for a reduction in the price of gas purchased from Iran.
"The gas we buy from Iran is the most expensive. If the price drops we can buy more," Erdogan said. "That's what a friendly country is."
He also called for expanding air links to medium-sized cities in Iran, and for an increase in electricity imports, as is already the case for several Turkish provinces.
During the visit, eight documents, particularly in the areas of transport, customs, industry and health were signed.