ISTANBUL (Reuters) - President Tayyip Erdogan said on Monday the United States was trying to create a “terror army” on Turkey’s southern frontier by training a Syrian border force that includes a Kurdish militia, and pledged to crush it before it came into being.

“A country we call an ally is insisting on forming a terror army on our borders,” Erdogan said in a speech in Ankara. “What can that terror army target but Turkey?”

“Our mission is to strangle it before it’s even born.”

On Sunday, the U.S.-led coalition said it was working with the mainly Kurdish YPG-led Syrian Democratic Forces (SDF) to set up a new 30,000-strong border force.

The plan has infuriated Turkey, which considers the YPG to be an extension of the PKK, a Kurdish group waging an insurgency in southern Turkey and deemed a terrorist organisation by Turkey, the United States and European Union.

“This is what we have to say to all our allies: don’t get in between us and terrorist organisations, or we will not be responsible for the unwanted consequences,” Erdogan said.

“Either you take off your flags on those terrorist organisations, or we will have to hand those flags over to you ...Our operations will continue until not a single terrorist remains along our borders, let alone 30,000 of them.”

Erdogan also said that Turkey’s armed forces had completed preparations for an operation against the Kurdish-controlled region of Afrin in northwest Syria and the town of Manbij.