Turkey's Deputy Prime Minister Numan Kurtulmus said defeating Daesh "while bringing in other terrorist organisations will in no way benefit Syria's future."
Turkey on Thursday vowed to retaliate against any cross-border actions by the YPG in Syria and not remain a silent "spectator" to activities that would harm its national interests.
The statement from Deputy Prime Minister Numan Kurtulmus came just a day after the Turkish military fired artillery at the YPG positions south of the town of Azaz in what it said was a response to the YPG's targeting of Turkey-backed FSA (Free Syrian Army) that are fighting Daesh along Syria's northern border region.
"Whether it is Daesh or PYD/YPG or any other organisation, it does not matter to us," Kurtulmus told reporters at the Adiyaman airport.
He said Turkey "will never be a spectator to the acts of terrorist groups" just beyond its borders.
YPG forms the core of the Syrian Democratic Forces (SDF) and is backed by the US in the fight against Daesh in Syria. Ankara views it as Syrian branch of the PKK, which has been designated a terrorist organisation by Turkey, the US and EU.
The PKK has been a waging three-decade armed campaign in Turkey.
Kurtulmus said Turkey's position was "clear" against any terrorist formation in northern Syria.
"Detaching Daesh from certain places while bringing in other terrorist organisations will in no way benefit Syria's future."
Kurtulmus also reiterated Ankara's opposition to the US arming of YPG and said US officials would understand this was the "wrong path."
"This is not a sustainable way for the US," Kurtulmus said, adding that supporting terror groups against other terror groups, like Daesh, could not be an option.
"We side with the territorial integrity of Syria," he added.
US stance creates air of uncertainty
The US and Turkey have been at loggerheads over Washington's support for the YPG.
US Defense Secretary Jim Mattis on Tuesday left open the possibility of longer-term assistance to YPG, saying the US may need to supply them weapons and equipment even after the capture of Raqqa from Daesh.
The announcement came just days after the US told Turkey it will take back weapons supplied to the YPG in northern Syria after the defeat of Daesh.
To add to the air of uncertainty and the risk of possible escalation, SDF warned on Thursday of the prospect of fierce confrontation with the Turkish army in northwestern Syria if it attacks SDF-controlled areas.
Naser Haj Mansour, a senior SDF official, said the SDF had taken a decision to confront Turkish forces "if they try to go beyond the known lines" in the areas near Aleppo where the sides exchanged fire on Wednesday.