For months, the US has been building up an alliance in the Middle East aimed at dislodging ISIS from its strongholds in both Iraq and Syria.
But these efforts have been complicated in recent weeks by one of Washington’s oldest allies in the region: Turkey.
The Turkish government is lashing out against factions currently battling ISIS. Ankara has been engaged in a very public war of words with the government in Iraq. At the same time, the Turkish military has been bombing US-backed Kurdish militants in Syria.
Part of this policy stems from Turkey’s unenviable position, living alongside two of the bloodiest, most destabilizing conflicts the Middle East has seen in a generation.
Iraq
Days before the start of the week-old Iraqi offensive to drive ISIS out of the northern Iraqi city of Mosul, Turkey’s President issued an unusual public demand to join the military operation.
“We have to take part in the Mosul operation,” said Recep Tayyip Erdogan.
The Turkish announcement drew angry rebukes from the Iraqi central government, and Iraqi Prime Minister Haider Al-Abadi openly accused Turkey of violating Iraqi sovereignty.
“The Mosul battle is an Iraqi battle and the ones who are conducting it are Iraqis,” Abadi later added.
Turkish officials have used several arguments to justify their inclusion in the Mosul offensive.
One revolves around the fear of further sectarian conflict between Mosul’s predominantly Sunni population and the Shi’ite-dominated military forces of the Iraqi government.
“If we accept Mosul’s current destiny, there will be a Sunni-Shia struggle,” Erdogan said in a speech October 18.
But behind the scenes, analysts say there is ongoing rivalry for influence in Iraq between Turkey and another regional powerhouse: Iran.
“Turkey and Iran have a tradition of silently competing with each other,” explained Ahmet Han, associate professor of international relations at Kadir Has University.
“The difference is that Turkey is speaking a lot and very loudly, but Iran is not,” Han added.
Last year, Turkey sent several hundred Turkish soldiers armed with tanks and artillery pieces to a base in Bashiqa, near Mosul. Iraq protested, saying it had not given permission for such a move.
And Turkey’s claims that it helped the Peshmerga by providing tanks, artillery and troops in weekend battles around Bashiqa drew another angry outburst from Iraq’s Prime Minister.
“We don’t want Turkish military forces on the ground,” Abadi said Monday. “The Turkish claim that they participated in the war is untrue.”
Meanwhile, majority Shiite Iran continues to enjoy influence within the Iraqi government, and among a number of Shiite militias that have been trained by the Iranian military.
In speeches before crowds of supporters, Erdogan has also argued that Turkey should determine Mosul’s future, based on the fact that the city was ruled more than a century ago by the Ottoman Empire.
That argument rankles many Iraqis.
But analysts say it finds a willing audience among some Turks who are still bitter about the collapse of the Ottoman Empire during World War I.
“Mosul is in the collective consciousness of all Turks,” explained political scientist Soli Ozel.
“It is usually believed that no matter what your political lineage is, it should rightly belong to Turkey.”
Syria
While they frequently speak about Mosul, Turkish officials have not been nearly as vocal about a series of attacks carried out by Turkish forces over the last week in neighboring Syria.
On Thursday, the Turkish Armed Forces announced in an email that warplanes carried out dozens of airstrikes against suspected Kurdish militia targets in northern Syria.
“As a result of the operation, 160 to 200 PKK/PYD terror organization members were neutralized,” the military claimed, referring to the Kurdistan Workers Party and its Syrian affiliate, the PYD.
PYD officials tell CNN the Turkish bombing raids killed far fewer people.
“The Turkish state numbers of the casualties are a lie,” said Fawzi Suleiman, a spokesman for the Syrian Kurdish fighters.
He said public funerals have been held for 17 people killed by the Turkish air and artillery strikes.
In subsequent days, the Turkish military announced it used artillery to support Syrian Arab fighters advance deeper into Kurdish-controlled territory.
For 30 years, PKK fighters have waged a guerrilla war against the Turkish state.
The unexpected rise several years ago of a Kurdish militia linked to the PKK in neighboring Syria caused great alarm in Turkey.
Turkish officials have denounced the US for providing military assistance to this Kurdish faction, even though it has proven to be one of the most successful fighting forces against ISIS in Syria.
After the Turkish aerial assault last week, Kurdish officials accused Turkey of helping ISIS.
“The main reason Turkey is shelling us is because Turkey wants to support ISIS,” Zuhat Kobani, a spokesperson for the PYD in Belgium, told CNN.
In fact, Turkish security forces have spent the last several months targeting suspected ISIS militants both at home and abroad.
But analysts say Turkish officials are much more worried about the possible establishment of a Kurdish statelet in Syria.
The PKK “is deemed as an existential threat,” said Han.
As part of its effort to project power onto the increasingly complex Syrian battlefield, Turkish troops moved across the border into northern Syria last August.
To this day, the Turkish military continues to maintain a presence along a band of Syrian territory.
Trouble at home
Turkey has good reason to feel vulnerable. The conflicts in Iraq and Syria have spilled over into Turkey, contributing to a surge in violence on the home front.
The country struggles with the burden of hosting millions of Syrian and Iraqi refugees.
ISIS militants have mounted a series of devastating bombings over the last several years that have claimed the lives of hundreds of Turks.
Meanwhile, Turkish security forces continue to clash on a nearly daily basis with PKK militants, mostly in predominantly Kurdish parts of southeastern Turkey.
Finally, the country is still reeling from a bloody, but failed attempt at a military coup last July.
The instability has contributed to a sharp down-turn in Turkey’s once vibrant tourism industry. Turkey’s currency fell to record lows week.
The political, security and economic woes come as Turkey’s President has embarked on a very public campaign to rewrite the constitution to grant him more powers.
“A lot of this is posturing for domestic political purposes,” says Soli Ozel, an international relations expert at Istanbul’s Kadir Has University.
Some observers note that rhetoric aimed at Turkish supporters does not translate well to audiences across the border in Syria and Iraq.
“Turkey’s unreasonable ‘irredentist rhetoric’ is all for domestic consumption,” wrote columnist Mustafa Akyol.
“A problem of those who rule Turkey today is being unable to comprehend the global impact of what they say to cheer up their emotional base.”