Washington(CNN) US officials are urging calm between Turkey and Iraq to keep the flaring tensions between the two key American allies from jeopardizing the fight against ISIS.
The flap over the presence of Turkish troops in northern Iraq, which the government in Baghdad objects to because the forces are there without its permission, could undermine recent gains in the fight against the terror group and disrupt the upcoming effort to retake Mosul.
"It is imperative for all parties to coordinate closely over the coming days and weeks to ensure unity of effort in defeating Daesh and to provide for the lasting security of the Iraqi people," State Department spokesman John Kirby said in a statement issued Tuesday, using another name for ISIS. Kirby however did not mention Turkey by name saying he was addressing "the role that international forces will play in the Iraqi operation to liberate Mosul."
The statement comes as tensions have increased between Turkey and Iraq amid ratcheted rhetoric from the leaders of both countries.
Turkish President Recep Tayyip Erdogan insisted Tuesday that Turkish troops would take part in the Mosul offensive whatever the views of the government in Baghdad.
Erdogan said Turkey would act inside Iraq and Syria on its own terms. "We do not need to take permission for this, we are not planning to get it," he told a conference in Istanbul.
The Turkish leader also slammed Iraq's Prime Minister Haider Abadi for raising his opposition to the contingent of Turkish soldiers, telling him "You should know your level."
For his part Abadi rebuked Erdogan in a post on Twitter, saying "we are not your enemy and we will liberate our land through the determination of our men and not by video calls" -- an apparent mocking reference to the attempted July coup in Turkey, when Erdogan appeared on Turkish television via a FaceTime video call claiming he was still in charge.
The Pentagon has also echoed the State Department's calls to focus on ISIS and to not let the current row distract from that fight.
"We call on both governments to focus on their common enemy: ISIL," Pentagon spokesman Matthew Allen told CNN, using the government's preferred acronym for the terror group. "It is imperative for all parties over the coming days and weeks to closely coordinate next steps to ensure unity of effort in our counter-ISIL fight."
A US defense official told CNN that 1,000 Turkish soldiers are stationed in Bashiqa in Nineveh province, northeast of the ISIS held-city of Mosul, the terror group's most important bastion in Iraq.
The area is close to the ISIS frontlines and Turkish troops recently repelled an ISIS attack on the Turkish installation. The soldiers are there to train Kurdish and Arab fighters as part of an "understanding," in the words of the US defense official, between Ankara and the semi-autonomous Kurdish Regional Government in northern Iraq.
The clock tower of the Dominican Mission Church in Mosul, built in the 1870s, was a gift from Empress Eugenie of France. The ancient city is almost 3,000 years old and has historically been important for trading. Located in northern Iraq near the borders of Syria and Turkey, it's situated on the Tigris river and set amid rich oil fields.
This print of Mosul is from the 1930s, when Iraq was a kingdom occupied by the British.
Among the many activities on the Tigris River in Mosul was wool washing.
The souks, or markets, of Mosul hummed with activity every day.
The famous leaning minaret of Mosul's 12th-century Great Mosque of al-Nuri towers in the background of this photo taken in the 1930s.
Lady Surma was the sister of the patriarch of the Assyrian Christian church in Mosul and became an ambassador for her people.
The British writer Agatha Christie arrived at this railway station in Mosul. Agatha Christie spent time in Mosul in the early 1950s while her husband, the archaeologist Max Mallowan, excavated the ancient site of Nimrud.
Two women look out over the Tigris from the 12th-century Bashtabiya Castle, a big part of Mosul's identity. ISIS destroyed the castle last year, according to the Iraqi Ministry of Tourism and Antiquities.
President Saddam Hussein waves to supporters from the balcony of the mayor's office in Mosul on a trip to see how farmers were faring under international sanctions.
A boy begs for money in 1996. By then, Iraq was reeling under punishing international sanctions and widespread corruption.
The mosque of the prophet Yunus (Arabic for Jonah from the Bible) stood on one of the two most prominent mounds of Nineveh's ruins and served at one time as an Assyrian Church. It contained Jonah's tomb and was destroyed by ISIS in 2014.
In this 2001 photo, a man stands before the Great Mosque's minaret, which leans like the Tower of Pisa and is nicknamed "al-Habda," or "the hunchback."
Kurds mingle with the crowds in central Mosul in 2002, just a few months before the U.S.-led invasion of Iraq.
Children at a school in Mosul in 2002. ISIS developed its own curriculum after it took control of the city in 2014.
Crowds gathered in Mosul in February 2003 to protest US threats of invasion.
Kurdish children play on a broken ferris wheel in Mosul, a month before the invasion of Iraq in 2003.
A teenage boy tends to a herd of sheep on the outskirts of Mosul in 2003.
The lake in Saddam Hussein's palace was off-limits to Mosul's ordinary citizens until the dictator was toppled in April 2003.
The University of Mosul is the second-largest in Iraq and boasted a rich tradition of learning. ISIS militants destroyed thousands of books and manuscripts housed at the university and developed a new curriculum.
Fierce clashes erupted in Mosul in the summer of 2003, and US soldiers found themselves in the midst of urban warfare.
Iraqi police patrolled the city in 2005.
This children's clothing factory in Mosul was operating after reconstruction efforts in 2007.
Moslawis walk past trash strewn about a busy market area in Mosul in 2009.
ISIS fighters parade down a main road in a commandeered Iraqi security forces vehicle after the militant group took control of Mosul in June 2014.
ISIS destroyed ancient Christian shrines and churches like this 13th-century church in the Assyrian town of Telskuf, not far from Mosul in the Nineveh plains.
Iraqis displaced from ISIS-controlled towns and villages take shelter at this camp in Qayyarah, a few miles south of Mosul. Aid workers warn an assault on Mosul could trigger an exodus of catastrophic dimensions.
While the Turkish government is locked in a decades-long battle with Kurdish separatists in Turkey and considers Kurdish groups in Syria to be terrorists, Turkey enjoys a close economic and political relationship with the Kurdistan Regional Government in Iraq, a semi-autonomous body that has welcomed the Turkish forces despite Baghdad's opposition.
Though Baghdad shares the Turkish and Kurdish goal of freeing Mosul from ISIS, it has long been wary of the Kurds and foreign powers exercising too much control and influence in northern Iraq, which could undermine the central government's authority and even increase the potential for secession.
In the short term, the Turkish presence could exacerbate strains between Baghdad and Kurdistan just as US officials have said that collaboration between them is essential to the Mosul fight.
The US defense official said that Turkey has recently increased its training efforts in Bashiqa in anticipation of the Mosul offensive. He said that the uptick likely contributed to the latest round of protest from Baghdad.
It also came after Erdogan declared his country couldn't be excluded from the Mosul offensive and the parliament renewed its approval of troops in Iraq and Syria.
Last week, Iraq's cabinet condemned Erdogan's statement as a blatant interference in Iraqi affairs and an attempt to stir up sedition, after the Iraqi government slammed Turkey for having "poisoned" relations with "futile statements."
The campaign to reclaim Mosul, Iraq's second-largest city, could begin as early as this month, and it's expected to be tough. Anything that makes the task harder for the US and its allies concerns US officials.
"We now have all the pieces in place," Brett McGurk, America's special presidential envoy for the fight against ISIS, told reporters at the State Department Friday.
But US officials acknowledge that creating the 30,000-strong force preparing to recapture Mosul has involved a lot of negotiations, as it comprises a wide array of groups, with the Kurdish Peshmerga and Iraqi army making up the bulk of the force. Iraqi security forces are leading the ground campaign in Iraq, battling ISIS with the backing of US and coalition airstrikes and advisers. The US recently announced the deployment of 600 additional US troops to aid in the city's capture.
"Getting all of these forces together and arranged ... takes an awful lot of work," McGurk said, pointing to more than 100 meetings over three and a half weeks attended by US officials to develop each group's battle plan.
"We worked very hard and had very close cooperation with our partners" in Baghdad and Iraqi Kurdistan "to agree on the overall disposition of forces, where everybody will go, what they will do," he added.
Iraqi forces push towards Mosul as refugees wait for aid
Smoke rises from al-Qayyara in the late afternoon light, as ISIS burns crude oil to block visibility from above.
Refugee camps outside al-Qayyara, Iraq, where people live in hostile conditions, with scorching desert winds and constant heat.
Iraqi mother Piswa Treish holds a picture of her son (right) who was killed by ISIS.
Iraqi forces move towards the al-Qayyara front line -- it's been more than two years since the army was in the area.
On the banks of the Tigris river, Iraqi forces extended a pontoon bridge to gain access into the al-Qayyara region.
The bridge has been a vital access point for forces moving forward, but also allowed people to flee from ISIS across the river.
McGurk said there have been similarly intense negotiations among Iraq's political groups about how to stabilize and govern the diverse city should the military campaign against ISIS in Mosul succeed, including which groups will be allowed to govern and police which parts of the city.
Nick Heras, a Middle East researcher at the Center for New American Security in Washington, told CNN that the Iraqi-Turkish dispute could pose "a serious challenge" to efforts to stabilize Mosul because it could lead to various factions vying for control amid what many believe would likely be a major refugee crisis.
Heras added that Baghdad, the Kurds, and Ankara were all vying for influence in Mosul, with the US caught "trying to play referee."
Heras said that Turkey was training some 4,000 Sunni Arab fighters, many of them former local police or low-level Iraqi army soldiers, as part of an effort to influence the political situation in Mosul following its liberation from ISIS. The government in Baghdad is ruled by a majority Shiite coalition, while the denizens of Mosul are largely Sunni.
The Iraqi Kurds and Turkish government are allies because "neither believe that Baghdad will have the ability to govern Mosul after ISIS," Heras said, and they want to ensure that the area remains stable rather than give rise to another terrorist or insurgent movement.
Heras added that Turkey has managed to extend a considerable amount of sway over the Kurdistan Regional Government in Erbil.
The US has not taken a firm position on the presence of Turkish troops in Iraq and has declined to rebuke Turkey publicly for its unauthorized troop presence. Despite the risks they pose to the Mosul mission and the integrity of a unified Iraq, the US is working closely with Turkey, its long-time NATO ally, in the ongoing effort to drive ISIS out of the Syria-Turkish border region in northern Syria.
Addressing the Turkey-Iraq strain, McGurk stressed the importance of maintaining the "sovereignty and territorial integrity of Iraq," adding that, "All military activities in Iraq have to be with the full consent and coordination of the government of Iraq."
This sentiment was echoed in the statement issued Tuesday, although that statement by Kirby did not mention Turkey by name.
The ISIS terror threat
People flee the scene of a terror attack at Istanbul's Ataturk airport on June 29. Turkish officials have strong evidence that ISIS leadership was involved in the planning of the attack, a senior government source told CNN. Officials believe the men -- identified by state media as being from Russia, Uzbekistan and Kyrgyzstan -- entered Turkey from the ISIS stronghold of Raqqa in Syria, bringing with them the suicide vests and bombs used in the attack,
the source said.
The ISIS militant group -- led by Abu Bakr al-Baghdadi, pictured -- began as a splinter group of al Qaeda.
Its aim is to create an Islamic state, or caliphate, across Iraq and Syria. It is implementing Sharia law, rooted in eighth-century Islam, to establish a society that mirrors the region's ancient past. It is known for killing dozens of people at a time and carrying out public executions.
Kurdish Peshmerga fighters fire missiles during clashes with ISIS in Jalawla, Iraq, on June 14, 2014. That month, ISIS took control of Mosul and Tikrit, two major cities in northern Iraq.
Traffic from Mosul lines up at a checkpoint in Kalak, Iraq, on June 14, 2014. Thousands of people
fled Mosul after it was overrun by ISIS.
ISIS fighters parade down an Iraqi street in this image released by the group in July 2014.
Aziza Hamid, a 15-year-old Iraqi girl, cries for her father while she and other Yazidi people are flown to safety after a
dramatic rescue operation at Iraq's Mount Sinjar on August 11, 2014. A CNN crew
was on the flight, which took diapers, milk, water and food to the site where as many as 70,000 people were trapped by ISIS. Only a few of them were able to fly back on the helicopter with the Iraqi Air Force and Kurdish Peshmerga fighters.
On August 19, 2014, American journalist James Foley
was decapitated by ISIS militants in a video posted on YouTube. A month later, they released videos showing the executions of American journalist Steven Sotloff and British aid worker David Haines.
ISIS militants stand near the site of an airstrike near the Turkey-Syria border on October 23, 2014. The United States and several Arab nations
began bombing ISIS targets in Syria to take out the group's ability to command, train and resupply its fighters.
A Kurdish marksman stands atop a building as he looks at the destroyed Syrian town of Kobani on January 30, 2015. After four months of fighting, Peshmerga forces
liberated the city from the grip of ISIS.
Safi al-Kasasbeh, right, receives condolences from tribal leaders at his home village near Karak, Jordan, on February 4, 2015. Al-Kasasbeh's son,
Jordanian pilot Moath al-Kasasbeh, was burned alive in a video that was released by ISIS militants. Jordan is one of a handful of Middle Eastern nations taking part in the U.S.-led military coalition against ISIS.
In February 2015, British newspapers report the identity of "Jihadi John," the disguised man with a British accent who had appeared in ISIS videos executing Western hostages. The militant was identified as Mohammed Emwazi, a Kuwaiti-born Londoner. On November 12, 2015, the Pentagon announced that Emwazi was in a vehicle
hit by a drone strike. ISIS later confirmed his death.
In March 2015, ISIS released video and images of a man being thrown off a rooftop in Raqqa, Syria. In the last photograph, the man is seen face down, surrounded by a small crowd of men carrying weapons and rocks. The caption reads "stoned to death." The victim was brutally killed
because he was accused of being gay.
An Iraqi soldier searches for ISIS fighters in Tikrit on March 30, 2015. Iraqi forces
retook the city after it had been in ISIS control since June 2014.
Dead bodies lie near a beachside hotel in Sousse, Tunisia, after
a gunman opened fire on June 26, 2015. ISIS claimed responsibility for the attack, which killed at least 38 people and wounded at least 36 others, many of them Western tourists. Two U.S. officials said they believed the attack might have been inspired by ISIS but not directed by it.
ISIS also claimed responsibility for what it called a suicide bombing
at the Al-Sadiq mosque in Kuwait City on June 26, 2015. At least 27 people were killed and at least 227 were wounded, state media reported at the time. The bombing came on the same day as the attack on the Tunisian beach.
A man inspects the aftermath of a car bombing in Khan Bani Saad, Iraq, on July 18, 2015.
A suicide bomber with an ice truck, promising cheap relief from the scorching summer heat, lured more than 100 people to their deaths. ISIS claimed responsibility on Twitter.
Two women hold hands after an explosion in Suruc, Turkey, on July 20, 2015. The blast
occurred at the Amara Cultural Park, where a group was calling for help to rebuild the Syrian city of Kobani, CNN Turk reported. At least 32 people were killed and at least 100 were wounded in the bombing. Turkish authorities said they believed ISIS was involved in the explosion.
Spectators at the Stade de France in Paris run onto the soccer field after explosions were heard outside the stadium on November 13, 2015. Three teams of gun-wielding ISIS militants
hit six locations around the city, killing at least 129 people and wounding hundreds.
Law enforcement officers search a residential area in San Bernardino, California, after a
mass shooting killed at least 14 people and injured 21 on December 2, 2015.
The shooters -- Syed Rizwan Farook and his wife, Tashfeen Malik -- were fatally shot in a gunbattle with police hours after the initial incident. The couple supported ISIS and had been planning the attack for some time, investigators said.
Two wounded women sit in the airport in Brussels, Belgium, after two explosions rocked the facility on March 22, 2016. A subway station in the city
was also targeted in terrorist attacks that killed at least 30 people and injured hundreds more. Investigators say the suspects belonged to the same ISIS network that was behind the Paris terror attacks in November.
A boy walks past bloodstains and debris at a cafe in Balad, Iraq, that was attacked by ISIS gunmen on May 13, 2016. Twenty people were killed.
Iraqi government forces patrol in southern Falluja, Iraq, on June 10, 2016. In late June,
a senior Iraqi general announced that the battle to reclaim Falluja from ISIS had been won.
McGurk attributed the row over the Turkish presence to "some miscommunication or something" that prevented Turkey from gaining the consent of the Iraqi government for Turkish troops deploying in the north when the units arrived a year ago.
But McGurk also welcomed the Turkish-trained forces joining the fight against ISIS in Mosul.
"They have trained a number of local Nineveh fighters and we are prepared to incorporate those fighters into the operation under the Iraqi command," he added.
Ankara and Baghdad summoned each other's ambassadors Wednesday after escalating rhetoric from both governments. The Foreign Ministry in Baghdad said the Turkish envoy had been called in because of "provocative statements" by Turkey. Iraq has vowed to formally protest the Turkish presence at the UN.
The US has said the dispute needs to be worked out bilaterally between the two allies.
"This is an issue for the government of Turkey and the government of Iraq to speak to," Pentagon Press Secretary Peter Cook told reporters Thursday in Washington.
A US defense official told CNN that the US takes no position on the legality of the Turkish presence in Iraq, with another official adding, "We are monitoring the situation closely."
CNN's Tim Lister, Hamdi Alkhsali and Isil Sariyuce contributed to this report.