The United States supports Kurdish groups in both Syria and Iraq as critical assets in the battle against the terror group.
But across the border in Iraq, Turkey enjoys a close relationship with the semi-autonomous Kurdish Regional Government (KRG) in the north.
It even has at least 1,000 troops stationed in northern Iraq, training police and volunteers for anti-ISIS operations with the blessing of the KRG -- and much to the annoyance of Iraq's central government
, another vital US ally.
Confused? Let's break it down.
Who are the Kurds?
The Kurds are an ethnic group in the Middle East who have never had a nation state of their own, resulting in Kurdish nationalist movements across the region.
They make up a sizable minority in a number of Middle Eastern nations, comprising about 10% of the population in Syria, 18% in Turkey, 15-20% in Iraq, and nearly 10% in Iran.
Kurdish fighters in northern Iraq, known as Peshmerga, and in northern Syria, known as the People's Protection Units or YPG, have proven some of the most effective fighting forces on the ground against ISIS.
Turkey is battling Kurdish militants
For decades, Turkey has been facing a violent insurgency from the Kurdistan Workers Party, or PKK -- a banned group that first took up arms against Turkey in 1984, seeking an independent state for the Kurdish minority concentrated in the southeast of the country.
Tens of thousands have been killed in the conflict, which resumed in earnest after a peace process collapsed in 2015.
The PKK is considered a terror group by Turkey, the United States and the European Union.
Turkey considers Syrian Kurdish fighters as terrorists, while its ally the US supports them
The main Kurdish militia force in northern Syria, which lies on Turkey's southern border, are the People's Protection Units, or YPG, often referred to as the armed wing of the Democratic Union Party (PYD), a Syrian Kurdish opposition party.
Turkey and others view the PYD and YPG as an offshoot of the PKK, indistinguishable from the separatist group banned in Turkey, says Fadi Hakura, a Turkey expert at Chatham House.
As such, he said, members of the YPG are considered terrorists, and Ankara has worked to drive them from Syrian territory along its southern border, fearing that an entrenched Kurdish canton there would fuel momentum for an independent greater Kurdistan that could claim Turkish territory.
When Turkish tanks rolled into northern Syria in August, their military efforts were focused not just against ISIS, but also the YPG -- groups that were already fighting each other.
The United States, on the other hand, draws a distinction between the YPG and the banned PKK, providing significant support to the Syrian Kurdish group as a critical fighting force against ISIS and other Islamist groups in volatile northern Syria. This has complicated the relationship between Washington and Ankara, its NATO ally and key partner in the fight against ISIS.
For their part, the YPG/PYD acknowledge that they draw inspiration from imprisoned PKK leader Abdullah Ocalan, "but are careful not to link themselves openly" to the banned group, says Hakura.
But Turkey has a good relationship with Iraq's Kurds
Despite Turkey's tensions with Kurds at home and in Syria, it enjoys close economic and political ties with Kurdish authorities in northern Iraq, which lies to Turkey's southeast.
The Kurdistan Regional Government, a semi-autonomous administration which presides over the predominantly Kurdish region of northern Iraq -- with the might of the Peshmerga military, a key force in the battle for Mosul
, behind it -- has developed a deepening relationship with Turkey in recent years, says Hakura.
Among other things, the KRG had proved an important export market for Turkish products, and a growing source of energy for Ankara.
And the KRG's nationalist agenda was viewed by Ankara as less of a threat to its interests than that of Syria's Kurds, says Hakura.
For one thing, there was more affinity among Kurds in Turkey for the PKK and PYD than there was for the KRG, he said.
"Turkey's feeling is that the KRG does not have territorial aspirations in Turkey itself, compared to the PKK and YPG," he said.
Will Turkey's strike on Syrian Kurds affect relationship with KRG?
While both the KRG and the PKK harbor Kurdish nationalist aspirations, the relationship between the groups has waxed and waned over the years, says Hakura. In recent times, the relationship has diminished as the KRG's ties with Turkey have grown.
"At times, they've enjoyed an alliance of convenience where their interests converged," said Hakura.
The two movements stem from quite different political traditions -- the PKK an anti-feudal, nationalist movement, the KRG operating according to a more tribal model of governance -- and there have been tensions between KRG President Massoud Barzani and Ocalan.
As such, Turkey's strikes on Kurdish militants in northern Syria last month were unlikely to affect Ankara's relationship with the KRG. Ankara says 160 to 200 Kurdish fighters were killed, although the HDP, a predominantly Kurdish political party in Turkey, says 14 people died.
"I doubt that the KRG will express any displeasure beyond rhetoric," said Hakura. "They will avoid any rupture with Ankara."
Turkey's military support for the KRG has angered another US ally
That relationship, between Ankara and the KRG, has proven another pressure point complicating anti-ISIS efforts in recent times, with Iraq -- another vital ally in the fight -- objecting to the presence of Turkish troops in northern Iraq.
The troops have been at a camp in Bashiqa, near Mosul, training police and volunteers for the fight against ISIS under an agreement with the KRG. Baghdad has objected to their presence, saying they are there without the central government's permission, but Turkey has insisted on the legitimacy of its stake in the future of the region, fueling tensions between the countries.
While the Peshmerga are a large part of the operation to drive ISIS from its stronghold in Mosul, northern Iraq, Baghdad is unhappy about the challenge to its authority presented by the Turkish troops' presence -- and ultimately is concerned about the independence aspirations of the KRG, says Hakura.
For Ankara, said Hakura, the troop presence is about expanding its influence in northern Iraq and helping to shape the outcome of the battle there -- an area that is heavily Sunni, like Turkey, and has a sizable community of Turkmen, a group ethnically related to the Turks.