ON January 20th Turkey launched a military operation (optimistically dubbed “Olive Branch”) in Syria's north-western enclave of Afrin. It started with over a hundred airstrikes in the space of several hours. When NATO’s second-largest army last entered Syria, in the autumn of 2016, its aim was to remove Islamic State (IS) militants from stretches of land overlooking the border. This time, the targets of their bombs were members of a Kurdish militia known as the People’s Protection Units, or YPG. Turkey’s president, Recep Tayyip Erdogan, pledged not to leave Syria until his troops had killed all the insurgents in Afrin.

Mr Erdogan’s government has long considered the YPG to be the Syrian branch of the Kurdistan Workers’ Party (PKK), whose insurgency against Turkey’s armed forces over three decades ago marked the start of a war that has since claimed some 40,000 victims. Turkey hardly distinguishes between the two Kurdish groups, and lists both as terrorist organisations. But its Western allies, and most crucially the United States, apply the terrorist label to the PKK only. This is the big problem. Claiming that the two Kurdish militias are distinct entities, America has enlisted the YPG as a key partner in the war against IS. Backed by American air power, the YPG has evicted the jihadists from much of eastern Syria, and from the capital of their makeshift caliphate, Raqqa, in a series of ferocious battles. American officials recently announced a plan to use YPG fighters as part of a “border security force” that would preserve the gains made against IS. This only confirmed Turkey’s worst fears—that the tactical alliance between Washington and the Syrian Kurds had turned into a strategic one.

When the Kurds cleared IS from its strongholds near the Turkish border, the relief felt around the world was not shared by Turkey. Mr Erdogan’s government seems to view the Kurdish insurgents as an even bigger threat than the jihadists. Despite vows to the contrary by YPG leaders, Turkey says it is a matter of time before the group begins staging cross-border attacks from its bases in Syria. (The PKK has done so for years from northern Iraq. Until the late 1990s Syria itself provided the PKK leadership with a safe haven, training camps and other assistance. It stopped doing so only when Turkey threatened it with an invasion.) Mr Erdogan insists this is precisely why he has unleashed his army, flanked by a ragtag force of Syrian anti-regime rebels, on Afrin.

It remains to be seen how far Turkey’s army can advance into the enclave before Russia, a Syrian ally whose missile defences give it control over the regional airspace, persuades it to stop or retreat. (This may happen once the YPG shelves its dreams of autonomy and offers the Syrian regime control of Afrin in exchange for protection against Turkey.) Already, Turkish troops and their rebel proxies are facing much more resistance from the Kurds than they did in the opening stages of the offensive against IS. Mr Erdogan, however, might be less interested in making headway than in making a point. The one he is now driving home with deadly force is that Turkish concerns about the American alliance with the Kurds need to be taken more seriously. There are some signs that the Americans have begun to look for ways to accommodate Turkey. The American side has reportedly suggested helping Mr Erdogan establish a safe zone south of the border with Afrin. But the mounting tension between the two NATO allies might boil over elsewhere. Of the 2,000 American special forces involved in the campaign against IS in Syria, many are based in Kurdish cantons east of Afrin. If Mr Erdogan decides to extend his offensive against the YPG to those areas, as he has promised to do, Turkish forces might find themselves face to face with American troops. A single casualty on either side and all bets are off.