ANKARA (Reuters) - Turkey's military struck dozens of Islamic State and Kurdish YPG militia targets in Syria over the last 24 hours, depriving both groups of the ability to move around, the army said on Monday, as its operation there entered a third month.

Backed by Turkish tanks, special forces and air strikes, rebels fighting under the banner of the Free Syrian Army crossed into northern Syria on Aug. 24 and took control of the border town of Jarablus from Islamic State largely unopposed.

In the latest moves in the operation, dubbed "Euphrates Shield", strikes by "fire support vehicles" hit 27 Islamic State targets and 19 belonging to the YPG, leaving both groups "without maneuvering capacity", the written statement said.

President Tayyip Erdogan said on Saturday the Turkish-backed forces would press on to the Islamic State-held town of al-Bab, emphasizing Ankara's drive to sweep its militants and Syrian Kurdish fighters from territory near its border.

The Syrian military said the presence of Turkish troops on Syrian soil was unacceptable and a "dangerous escalation and flagrant breach of Syria's sovereignty."

Erdogan also said Turkey would do what was necessary with its coalition partners in Syria's Raqqa, but would not work with the Syrian Kurdish fighters.

Differences over Syria have caused strains between NATO allies Turkey and the United States. Washington is backing the YPG militia, seeing it as an effective partner in the fight against Islamic State. Turkey fears the militia's advance will embolden Kurdish militants at home.

The Kurdistan Workers Party (PKK), designated a terrorist organization by Turkey and its Western allies, has fought a three-decade insurgency that has killed more than 40,000 people, mostly Kurds, in Turkey's largely Kurdish southeast.

(Writing by Ece Toksabay; Editing by Toby Chopra)