Updated

Turkey has told the United States it will not join in any military operations that include Kurdish fighters in Syria, President Recep Tayyip Erdogan said Thursday, while vowing to strike the U.S.-backed Kurds if they threaten Turkey's security.

Turkey's foreign minister also demanded that a U.S. envoy be removed for allegedly backing the Kurds, but the State Department said Brett McGurk has the "full support" of the Trump administration.

Speaking in Istanbul two days after meeting President Donald Trump in Washington, Erdogan criticized the U.S. decision to ally with "terror organizations" for the long-awaited operation to capture Raqqa, the de facto capital of the Islamic State group.

"We said we would not be in such an operation with you where you ally with terror organizations and so we said good luck," Erdogan said.

Turkey considers the People's Protection Units, or YPG, in Syria a terror organization and an extension of the Kurdistan Workers' Party (PKK), which has waged a three-decade-long insurgency against the Turkish state.

Erdogan said he warned Trump that Turkey would combat YPG if the group posed any security threat. "We are already telling you in advance, our rules of engagement give us this authority, we will take such a step and we won't discuss it or consult with anyone. Because we have no time to lose," he said.

Citing a cross-border offensive Turkey launched against IS and the YPG in Syria last year, Erdogan said "we won't hesitate to launch similar operations if we see the need."

Earlier Thursday, Foreign Minister Mevlut Cavusoglu said the Trump administration understood Turkey's position against the YPG. "They did not say anything negative about this issue and treated it with understanding," he said.

In April, the U.S. had criticized Turkish airstrikes against Kurdish militants in Syria and Iraq.

Cavusoglu said Trump's administration seems more understanding about Turkey's security concerns. He went on to plead for the replacement of Brett McGurk, the U.S. presidential envoy for the global coalition against IS.

"This McGurk is definitely supporting the PKK and YPG. It would be beneficial for this person to change," he said, accusing the diplomat of carrying on Obama-administration policies.

State Department spokeswoman Heather Nauert said McGurk has done "tremendous work" in coordinating and leading the international coalition against IS, and has the support of the White House and Secretary of State Rex Tillerson.

The U.S. respects Turkish concerns about its "by, with, and through" approach to the Syrian Democratic Forces led by the YPG, and will continue consulting with Ankara as the focus on combating IS continues, Nauert said.

Cavusoglu said Turkey received U.S. assurances that arms sent to the YPG would be used only against IS, without explaining how this would be monitored.

"The weapons provided will only be used in Raqqa and its south, they will absolutely not be used against Turkey, this will not be allowed," Cavusoglu said. "Turkey and the U.S. will together run an active combat against the PKK."

A cease-fire between Turkey and the PKK collapsed in July 2015 after a two-and-a half year hiatus in fighting, leading to clashes in Turkey's southeast and round-the-clock curfews as well as airstrikes on alleged PKK camps in northern Iraq.

According to the International Crisis Group, at least 2,798 people, including state security personnel and Kurdish militants, have been killed in Turkey. The death toll includes nearly 400 civilians.

The PKK is considered a terror group by the U.S. and Turkey's Western allies.

___

Josh Lederman contributed from Washington.