Turkish troops fired on U.S.-backed Kurdish guerrilla fighters in northern Syria on Thursday, highlighting the complications of an incursion meant to secure the border region against both Islamic State and Kurdish advances.

Syrian rebels backed by Turkish special forces, tanks, and warplanes entered Jarablus, one of Daesh ‘ISIS”s last strongholds on the Turkish-Syrian border, on Wednesday.

But President Tayyip Erdogan and senior government officials have made clear the aim of “Operation Euphrates Shield” is as much about stopping the Kurdish YPG guerrillas seizing territory and filling the void left by Islamic State as it is about eliminating the ultra-hardline Islamist group itself.

Turkey, which has NATO’s second biggest armed forces, demanded that the YPG retreat to the east side of the Euphrates river within a week. The Kurdish guerilla had moved west of the river earlier this month as part of a U.S.-backed operation, now completed, to capture the city of Manbij from Daesh.

Ankara views the YPG as a threat because of its close links to Kurdish guerrillas waging a three-decade-old insurgency on its own soil. It has been alarmed by the YPG’s gains in northern Syria since the start of the Syrian civil war in 2011, fearing it could extend Kurdish control along Turkish borders and fuel the ambitions of Kurdish insurgents in Turkey.

Turkey’s stance has put it at odds with Washington, which sees the YPG as a rare reliable ally on the ground in Syria, where Washington is trying to defeat Daesh while also opposing President Bashar al-Assad’s government in a complex, multi-sided, five-year-old civil war.

The Syrian Kurdish force is one of the most powerful guerrillas in Syria and regarded as the backbone of the Syrian Democratic Forces (SDF), a U.S.-backed alliance formed last October to fight Daesh.

Turkish Defense Minister Fikri Isik said the Kurdish PYD party, the political arm of the YPG, wanted to unite Kurdish-controlled cantons east of Jarablus with those further west. “We cannot let this happen,” he said.