Turkey, which has been fighting the separatist Kurdistan Workers’ Party, or P.K.K., in Turkey for three decades, has accused the United States of bolstering the group by arming and training its Syrian affiliate, the Y.P.G., which forms the backbone of the Syrian Democratic Forces. The United States considers the P.K.K. a terrorist group, but says the Y.P.G. is the force in Syria most capable of fighting the Islamic State.

American Special Operations forces are working with the Syrian Democratic Forces to combat remnants of the Islamic State in eastern Syria. Even as Turkey was threatening military action, the Syrian Democratic Forces announced that its fighters had taken control of Hajin, the last town in Syria held by the Islamic State.

Mostapha Bali, a spokesman for the Syrian Democratic Forces, said that the group would resist any Turkish intervention, which he said would force it to halt the fight in Hajin.

“We will retaliate if attacked,” he said, adding, “We won’t give up to the Turkish. We hope the Turks will stop their threats, but if they decide to commit foolishness and continue their offensive, the battle in Hajin will definitely stop.”