Turkish Foreign Minister Mevlut Cavusoglu was in Iraq on Wednesday to warn Iraqi and Kurdish leaders against next month's independence referendum in the country's Kurdish region.
Cavusoglu had already warned last week that the vote planned for September 25 could even bring Iraq "to civil war".
After holding talks in Baghdad, the Turkish minister was due to meet Iraqi Kurdistan president Massud Barzani in Arbil, the capital of the autonomous region.
"The decision to hold this referendum is a mistake," Cavusoglu told a joint news conference with Iraqi counterpart Ibrahim al-Jaafari.
"We have said it before (to Iraqi Kurdish leaders) and today during my visit to Arbil I will repeat that it is a mistake."
The referendum is non-binding but goes against the Iraqi constitution and has faced criticism from Turkey and Iran, which fear it could encourage secession in their own Kurdish regions.
"We hope that all the problems between Baghdad and Arbil will be settled within the borders of Iraq and in the unity and security of Iraqi territory," said Cavusoglu.
"I repeat to Arbil that (Kurdistan) can enjoy the rights it claims in the borders of a united Iraq," he said, adding that Turkey could "play a role" if the two sides wanted it.
Cavusoglu said the presence in Iraq of the Kurdistan Workers' Party (PKK), which is outlawed in Turkey, "endangers the unity and security of Iraqi territory."
The minister said Ankara would support Baghdad "by all means to rid Iraqi territory of the PKK".
After meeting Jaafari, Cavusoglu was scheduled hold talks in Baghdad with Iraqi President Fuad Massum and Prime Minister Haider al-Abadi before travelling to Arbil.