Turkish Prime Minister Ahmet Davutoglu said on Saturday that Turkey had struck YPG targets near the town of Azaz in northern Syria in retaliation under the Turkish Army's rules of engagement.
Davutoglu said that the government warned the group many times to withdraw from the area, which has recently been captured, however it chose to violate the Turkish territory, shelling military outposts near the Turkish border.
"We will retaliate against every step [by the YPG]," Davutoğlu told reporters during a televised broadcast.
"The YPG will immediately withdraw from Azaz and the surrounding area and will not come close to it again."
The shelling took place on Saturday after YPG militants started to shell a former military airbase near the Turkish border.
The Syrian Observatory for Human Rights, which monitors the war, said the shelling had targeted the airbase and a village which were captured by the PYD-backed YPG militants.
A Kurdish official also confirmed the shelling of the Menagh base.
Earlier on Saturday he had also said that Ankara would, if necessary, take military action against the PYD, if it poses a threat to Turkey.
During his speech in the televised broadcast, Davutoglu repeated once more from the eastern Turkish city of Erzincan that "When there is any threat to Turkey, we will take in Syria the measures that we took in Iraq and in Qandil and will not hesitate to implement the necessary measures."
Davutoglu also said that the YPG is attempting an ethnic cleansing against Arabs and Turkmens in the region in cooperation with the Syrian regime, adding that for this reason the group must withdraw from Azaz and its surroundings.
The YPG is the armed wing of the PYD, which is considered by Turkey to be the PKK’s Syrian extension. The PKK is recognised as a terrorist organisation by Turkey, the EU and the US.
The YPG has recently continued its activities, receiving Russian support in northern Syria.
Davutoglu also said that he had a telephone conversation with US Vice President Joe Biden following the recent developments.