Erdogan has refused, insisting that Turkey has a role to play in liberating the city from the jihadists, and with tempers rising, both sides have resorted to

Abadi has repeatedly urged Turkey to withdraw troops deployed near the northern city in an area nominally part of Iraq but controlled by forces loyal to the country's autonomous Kurdish region.

But recent preparations for the looming offensive have been overshadowed by tensions between Turkey's President Recep Tayyip Erdogan and Iraq's Prime Minister Haider al-Abadi.

Iraq is preparing to fight to liberate Mosul from the Islamic State group with support from the United States and a broad -- though sometimes fractious -- coalition of international partners.

As Turkey and Iraq traded insults over the Turkish troop presence outside Mosul on Tuesday, the United States urged its allies to resolve the spat before a major offensive on the city.

insults.

In Washington, State Department spokesman John Kirby said the operation would be led by Iraq and that it was a matter for Baghdad which forces should be deployed on its sovereign territory.1

Haider al-Abadi, Prime Minister of Iraq has repeatedly urged Turkey to withdraw troops deployed near Mosul in an area nominally part of Iraq but controlled by forces loyal to the country's autonomous Kurdish region (photo by: Dominick Reuter/AFP/File)

"The Turkish forces that are deployed in Iraq are not there as part of the international coalition and the situation in Bashiqa is a matter for the governments of Iraq and Turkey to resolve," he said.

Ankara maintains an estimated 2,000 troops in Iraq, around 500 of them in the Bashiqa camp training local fighters whom Turkish media say will join the battle to recapture Mosul.

"It is imperative for all parties to coordinate closely over the coming days and weeks to ensure unity of effort," Kirby added later, in a statement released as Ankara and Baghdad traded barbs.

Abadi's latest gibe was scripted to get under Erdogan's skin, mocking a desperate video call he made to a television station in July to prove he was still alive during a military coup attempt.

"We will liberate our land through the determination of our men and not by video calls," Abadi's official Twitter account said.

Earlier, Erdogan had sneered at Abadi's call for him to withdraw his force back to Turkey.

"It's not important at all how you shout from Iraq. You should know that we will do what we want to do," he said.

"Who's that? The Iraqi prime minister. First you know your place!"

The Kurdish peshmerga forces that control the area where Turkey's troops are deployed are in practice not under Abadi's command, but they are expected to play a key role in the upcoming battle.