By Daren Butler and Humeyra Pamuk

ISTANBUL, May 18 (Reuters) - Turkey said on Thursday the U.S. special envoy in the battle against Islamic State should be removed because he supported Kurdish militants, and warned that Ankara would act unilaterally if it faced attack from the Syrian Kurdish YPG militia.

The comments, which followed a White House meeting on Tuesday between President Tayyip Erdogan and U.S. President Donald Trump, reflected Turkish anger at Trump's decision to arm YPG fighters who are part of a force aiming to recapture the Islamic State-held Syrian city of Raqqa.

Ankara regards the YPG militia as an extension of Kurdistan Workers Party (PKK) militants fighting a decades-old insurgency in southeast Turkey, while Washington sees the YPG as its most reliable ally for the Raqqa campaign.

Turkey has long complained that U.S. policy against Islamic State in Syria has favoured the YPG over Arab rebel forces, a policy that Turkish officials believe is driven partly by Washington's envoy to the international coalition against the jihadist group.

"Brett McGurk, the USA's special envoy in the fight against Daesh (Islamic State), is definitely and clearly giving support to the PKK and YPG. It would be beneficial if this person is changed," Foreign Minister Mevlut Cavusoglu told NTV television.

The United States and the European Union, along with Turkey, designate the PKK a terrorist organisation.

Erdogan, speaking to reporters at the Turkish embassy in Washington after the talks with Trump, said he told the U.S. president that Turkey would not hesitate to strike if it faced any sort of attack from the YPG, Turkish media reported.

"We clearly told them this: if there is any sort of attack from the YPG and PYD against Turkey, we will implement the rules of engagement without asking anyone," Sabah newspaper cited him as saying. The PYD is the YPG's political arm.

Erdogan did not specify what measures he might order, but said Turkey had shown its fighting capabilities when Turkish forces and Syrian rebels seized territory in northern Syria last year, pushing back Islamic State fighters and prompting a limited withdrawal of the YPG militia.

"Indeed we did this in Rai, Jarablus, al-Bab. Turkey showed what it can do," Erdogan said. "We will not give terrorist groups breathing space domestically or abroad."

TENSIONS WITH ALLIES

Cavusoglu said Trump had understood Turkey's position, and did not challenge Erdogan when the Turkish president set out his possible response to the YPG.

Last month, Turkish warplanes bombed Kurdish fighters in Iraq's Sinjar region and YPG militia in Syria, drawing rebuke from Washington which voiced concern over the air strikes and said they harmed the coalition's fight against Islamic State.

Erdogan said that the United States had made its decision on conducting the Raqqa operation - despite Ankara's opposition - and that Turkey could not participate given the YPG involvement.

"We told them ... we do not regard your cooperation with a terrorist group in Raqqa as healthy," he was cited as saying.

But he said he expected a role for Turkey in Syria, and repeated Turkey's assertion that once Raqqa was retaken from Islamic State, Kurdish forces could not be left in control of an Arab city. "I believe they will knock on our door on the subject of Syria," he said.

The tensions with Washington over the YPG come as Turkey's relations with the European Union, and Germany in particular, have also deteriorated.

Turkey has prevented German parliamentarians visiting its Incirlik airbase, where 250 German troops are based as part of a mission which includes German surveillance planes supporting the campaign against Islamic State in Syria and Iraq.

Defence Minister Ursula von der Leyen said on Wednesday the German government had been evaluating possible alternatives to Incirlik and was considering moving the troops to Jordan.



(Additional reporting by David Dolan; Editing by Dominic Evans and Ralph Boulton) ((daren.butler@tr.com; +90-212-350 7053; Reuters Messaging: daren.butler.thomsonreuters.com@reuters.net))