A series of Turkish airstrikes targeting American-allied Kurdish militias in Iraq and Syria threaten to put Turkey and the United States on a “collision course,” experts have warned.

Syrian activists said the attacks, on Sinjar Mountain in northern Iraq and a mountainous region in Syria, killed at least 18 members of the Syrian Kurdish militia known as the People’s Protection Units, or YPG, which are at the center of bitter divisions between the two NATO allies.

The U.S. military is working closely with Kurdish fighters in Syria, considering them as the only viable force capable of seizing the city of Raqqa from the Islamic State. But Turkey regards the militias as a direct offshoot of a Kurdish militant group that poses a grave threat to Turkish security. As a result, a crisis is brewing over the U.S. partnership with the militias.

“The collision course is coming. It’s already come in some respects and it’s a question of how badly this deteriorates,” says Michael Hanna, a senior fellow at the New York-based Century Foundation. “There are U.S. personnel on the ground. In the worst case scenario you’re having Turkey, a NATO ally, a close traditional partner of the United States, could kill American personnel on the ground,” he tells TIME.

U.S. support for the YPG has raised tensions with Turkey for over two years. The YPG are closely linked to another organization, the Kurdistan Workers’ Party (PKK), a revolutionary armed group that has waged a decades long struggle for autonomy in the name of Turkey’s Kurdish minority. President Recep Tayyip Erdogan once tried to negotiate peace with the PKK but is now in a political partnership with Turkey’s ultranationalist party, a coalition that precludes any return to the peace process.

Both Turkey and the U.S. list the PKK as a terrorist organization, but the U.S. insists that its militia partners in Syria are a separate group from the PKK guerillas fighting Turkey. Yet the two organizations have direct ties, and Kurdish citizens of Turkey are among the YPG’s fighters. After U.S. military officials visited the site of the Turkish airstrikes in Syria, photos surfaced online that appeared to show a U.S. military official standing alongside a commander from the PKK.

In Washington, U.S. officials continued to stress the distinction between the two militant groups. At a news briefing on Wednesday, State Department spokesman Mark Toner told journalists, “I would strongly call into question, with all due respect, that senior military leaders of the U.S. were somehow glad-handing or shaking hands with PKK leaders. As I said, the PKK is a recognized foreign terrorist organization by the United States.”

The airstrikes did not just fray relations with the U.S. The Sinjar attack killed at least five members of yet another Kurdish force, the peshmerga, who are backed by the semi-autonomous Kurdish government in northern Iraq, an ally of both Turkey and the U.S. In an acknowledgement of the mistake, Turkey’s Prime Minister Binali Yildirim phoned the president of the Kurdish government in Iraq, Masoud Barzani, to offer condolences, Turkey’s state news agency reported on Thursday.

Turkey-U.S. relations are deteriorating just as the U.S. gears up for an assault on the Syrian city of Raqqa, the de facto capital of the Islamic State. The U.S. sent Marines to Syria in March in an expansion of the American role in the ground war there and in a sign that it plans to contain its partnership with an umbrella group called the Syrian Democratic Forces, which include members of the Kurdish militias. The new deployment deepened America’s partnership with the militias, and raised the risk of a confrontation with Turkey.

Turkey remains adamantly opposed to Kurdish militia playing a role in the Raqqa campaign, and have instead floated the idea of Turkish-backed Syrian rebel forces joining the fight to liberate Raqqa. These forces recently retook the city of al-Bab, near Aleppo, from ISIS, but U.S. officials do not appear to regard the Turkish proposal as a viable option.

“There isn’t an easy solution to this problem, and now Turkey has raised the stakes somewhat,” says Noah Bonsey, a senior analyst on Syria at the Brussels-based International Crisis Group. “It could quickly spiral,” he adds.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.