Turkish President Recep Tayyip Erdogan said Iraqi Prime Minister Haidar al-Abadi should "know his place" and added that a Turkish Army contingent in Iraq will not take orders from Baghdad.
Erdogan told a group of Islamic leaders in Istanbul on October 11 that Iraq had requested some military aid from Turkey and is now "telling us to leave" its camp at Bashiqa in northern Iraq.
Abadi has warned Turkey that it risked triggering a "regional war" by keeping troops in Iraqi territory. Turkey has said it was invited into Iraq to help secure an area that was taken over by Islamic State (IS) militants in 2014.
But Erdogan said the Turkish army will not "take orders from you," adding: "The Iraqi prime minister is insulting me."
"You are not my equivalent, you are not of the same quality as me," Erdogan continued. "Your screaming and shouting in Iraq is of no importance to us."
Turkish officials have said Turkish forces should play a role in liberating Mosul -- Iraq's second-largest city -- from IS fighters.
Abadi has pledged to retake Mosul by the end of the year.