Gul's visit to Baghdad was the first by a Turkish head of state in 33 years. Turkish Prime Minister Tayyip Erdogan's trip to Iraq last year started to smooth relations that had become strained over the Kurdish issue.
Turkey has accused the Kurdish Regional Government in northern Iraq, which has enjoyed de facto autonomy from Iraq since 1991, of not doing enough to squelch the militant arm of the Kurdistan Workers Party (PKK) in Turkey.
After meeting with Gul, Iraqi President Jalal Talabani, himself Kurdish, warned rebels based in Iraq's northern mountains to lay down their arms or leave the country -- the strongest words yet by any Iraqi leader against the PKK.
Gul also met with Kurdish Prime Minister Nechirvan Barzani and said he told him "explicitly that the PKK terrorist organization and their camps are ... in your region (and) you need to take a clear position against them," quoted Reuters.
Barzani told reporters after the meeting, "We are determined, and we confirm again our territory will not be used to attack Turkey."
But he added that it would be "a positive and blessed step" if Turkey gave the PKK amnesty, something Turkey has so far not considered.
The PKK, which is considered a terrorist organization by the United States and European Union, is fighting for an ethnic homeland in southern Turkey. Kurdish rebellions date back to the 1920s when Turkey imposed restrictions on use of the Kurdish language and other aspects of the group's identity in an effort to assimilate the population into a Turkish state.
Kurdish fighters have attacked Turkish soldiers, and the military has responded with air and ground assaults on Kurdish strongholds in Iraq. More than 40,000 people have died in clashes since the PKK launched its separatist movement in 1984.
Also on the agenda during the two days of meetings was the issue of water supplies. According to Iraqi Vice President Tareq al-Hashemi, Gul promised to double the amount of water allocated to Iraq from the Tigris and Euphrates rivers, reported the Agence France-Presse.
Gul "explained that the drought last year had affected the amount of water for Iraq and Syria, but this year sufficient water would see supply being doubled," al-Hashemi told the AFP.
A network of dams on the two rivers, which have their source in Turkey, that were built as part of a massive irrigation project for the southern Anatolia region has reduced the flow of water to Iraq.
In January 2008, Iraq, Syria and Turkey reached water-sharing agreements but they have not been implemented yet, according to the AFP.