"The PKK is a threat not only to Iraq and Turkey but to the whole region. We don't allow such organisations to poison the relations between the two countries."
Turkish troops regularly carry out cross-border raids into northern Iraq, where Ankara says more than 2,000 Kurdish fighters are base themselves in order to carry out attacks inside Turkey.
In February, Turkish troops conducted a week-long ground offensive against a PKK camp in the Zap area. The operation left more than 200 PKK fighters dead, according to the Turkish army.
Blacklisted as a terrorist group by the EU and the US, the PKK has been fighting for self-rule in Turkey's mainly Kurdish southeast since 1984. The conflict has claimed more than 37,000 lives.
Baghdad said it and Ankara had decided to set up a high level team to address strategic issues, including "supporting the efforts of the Iraqi government in fighting terrorism an preserving Iraq's independence, full sovereignty, territorial integrity and national unity against threats."
Erdogan is only the second leader from one of Iraq's neighbours to visit since the March 2003 invasion, after Mahmoud Ahmadinejad, the Iranian president, made a historic trip in March.
His visit came a day after men opened fire on the US consulate in Istanbul, triggering a shootout that left the three men, and three police officers dead.
Ergdogan pladged to support reconstruction efforts, while Baghdad said it would look into building a pipeline network to transport natural gas from Iraq to international markets through Turkey.