The two leaders held talks in Istanbul before attending a Ramadan dinner together.
A picture on the Turkish presidency's official website showed Erdogan and Saleh gathering around a round table together with their wives.
Erdogan accuses Syria regime of undermining Turkey-Russia deal
The visit came as the Turkish military launched an air and ground offensive in mountainous northern Iraq against the hideouts of the outlawed Kurdistan Workers' Party (PKK), listed as a terror group by Ankara and its Western allies.
Special forces and combat drones were also involved in the offensive which started late on Monday, the defence ministry said in a statement.
The operation aims at eradicating "caves and shelters used by terrorist groups", it said.
In Iraq, religious rap meets a chorus of controversy
Turkey and the PKK have been engaged in fierce fighting since a fragile ceasefire broke down in 2015. The insurgency has claimed tens of thousands of lives since the group took up arms in 1984.
Turkey allowed imprisoned PKK leader Abdullah Ocalan to meet his lawyers this month for the first time in eight years.
Some 3,000 Kurdish prisoners on Sunday ended a months-long hunger strike against Ocalan's prison conditions after the militant leader urged them to stop it, through the lawyers he met in his prison island near Istanbul.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ