Turkey will not allow the northern Syrian town of Azaz to fall into the hands of a Kurdish militia and its fighters will face the "harshest reaction" if they approach it again, Prime Minister Ahmet Davutoglu says.
A major offensive supported by Russian bombing and Iranian-backed Shi'ite militias has brought the Syrian army to within 25km of the Turkish border.
The Kurdish YPG militia has exploited the situation, seizing ground from Syrian rebels to extend its presence along the Turkish border.
Turkey is infuriated by the expansion of Kurdish influence in northern Syria, fearing it will encourage separatist ambitions among its own Kurds. The YPG, which Ankara considers to be a terrorist group, controls nearly all of Syria's frontier with Turkey.
Davutoglu said on Monday that YPG fighters would have taken control of rebel-held Azaz and the town of Tal Rifaat further south had it not been for Turkish artillery firing at them over the weekend.
"YPG elements were forced away from around Azaz. If they approach again they will see the harshest reaction. We will not allow Azaz to fall," Davutoglu said.
He said Turkey would make the Menagh air base north of the city of Aleppo "unusable" if the YPG, which seized it over the weekend from Syrian insurgents, did not withdraw.
Azaz came under heavy fire again on Monday. At least 14 civilians were killed when missiles hit a children's hospital, a school and other locations, a medic and two residents said.
In a separate incident seven people were killed in air strikes on a hospital supported by Medecins Sans Frontieres (MSF) near Murat al-Numan in the northern Syrian province of Idlib, the charity's France president said on Monday.
He said he believed Russian or Syrian military forces were behind the attack.
"There were at least seven deaths among the personnel and the patients, and at least eight MSF personnel have disappeared, and we don't know if they are alive," Mego Terzian told Reuters.
"The author of the strike is clearly ... either the government or Russia," he said.
The Turkish army hit YPG positions in Syria for a third day on Monday following an attack on a border security outpost in the Turkish province of Hatay, foreign ministry spokesman Tanju Bilgic said.
Turkish Defence Minister Ismet Yilmaz denied a report that some Turkish soldiers had entered Syria at the weekend and said Ankara was not considering sending troops there.
The Syrian government had said Turkish forces were believed to be among 100 gunmen who entered Syria on Saturday with a dozen pick-up trucks mounted with heavy machine guns, in an operation to supply insurgents fighting Damascus.
"It is not true ... There is no thought of Turkish soldiers entering Syria," Yilmaz said.