ANKARA (Reuters) - Turkey warned the United States on Wednesday that a decision to arm Kurdish forces fighting Islamic State in Syria could end up hurting Washington, and accused its NATO ally of siding with terrorists.

The rebuke came a week before President Tayyip Erdogan is due in Washington for his first meeting with U.S. President Donald Trump, who approved the arms supply to support a campaign to retake the Syrian city of Raqqa from Islamic State.

Turkey views the YPG as the Syrian extension of the outlawed Kurdistan Workers Party (PKK), which has fought an insurgency in southeast Turkey since 1984 and is considered a terrorist group by the United States, Turkey and Europe.

“We want to believe that our allies will prefer to side with us, not with a terrorist organization,” Erdogan told a news conference in Ankara, saying he would convey Turkey’s stance to Trump next week and at a NATO summit later this month.

He said he hoped that recently taken decisions would be changed by the time he visits the United States.

Earlier, Prime Minister Binali Yildirim told reporters the U.S. failure to consider Turkey’s sensitivities “will surely have consequences and will yield a negative result for the U.S. as well”.

The United States regards the YPG as a valuable partner in the fight against Islamic State militants in northern Syria. Washington says that arming the Kurdish forces is necessary to recapturing Raqqa, Islamic State’s de facto capital in Syria and a hub for planning attacks against the West.

That argument holds little sway with Ankara, which worries that advances by the YPG in northern Syria could inflame the PKK insurgency on Turkish soil.

Weapons supplied to the YPG have in the past fallen into PKK hands, said Turkish Foreign Minister Mevlut Cavusoglu.

“Both the PKK and YPG are terrorist organizations and they are no different apart from their names,” he told a televised news conference. “Every weapon seized by them is a threat to Turkey.”

The YPG said Washington’s decision would bring swift results and help the militia “play a stronger, more influential and more decisive role in combating terrorism”.

The Pentagon said on Tuesday it was aware of concerns in Turkey, which has given vital support to a U.S.-led campaign against Islamic State insurgents in Syria and Iraq. Jets carrying out air strikes against the jihadist group have flown from Turkey’s Incirlik air base.

Erdogan has repeatedly castigated Washington for its support of the YPG.

Slideshow ( 3 images )

“SAME SACK”

Deputy Prime Minister Nurettin Canikli said the United States should review its move. “We hope the U.S. administration will put a stop to this wrong and turn back from it,” he said in an interview with Turkish broadcaster A Haber.

“Such a policy will not be beneficial; you can’t be in the same sack as terrorist organizations.”

Slideshow ( 3 images )

But U.S. Defense Secretary Jim Mattis said he was confident the United States would be able to resolve the tensions.

“We’ll work out any of the concerns. We will work very closely with Turkey in support of their security on their southern border. It’s Europe’s southern border, and we’ll stay closely connected,” Mattis told reporters during a visit to the Pabrade Training Area in Lithuania.

Ankara has argued that Washington should switch support for the Raqqa assault from the YPG to Syrian rebels Turkey has trained and led against Islamic State for the past year - despite U.S. scepticism about their military capability.

“There is no reality in the comments that a ground operation against Daesh (Islamic State) can only be successful with the YPG. I hope they turn back from this mistake,” Canikli said.

Despite the angry language, Erdogan’s government has little prospect of reversing Washington’s decision, and any retaliatory move would come at a cost.

Cavusoglu said Trump would address the issue with Trump during his planned May 16-17 visit to Washington, suggesting there were no plans to call off the talks in protest.

“Turkey doesn’t have much room to move here,” said Sinan Ulgen, a former Turkish diplomat and analyst at Carnegie Europe. “I think Washington made such an evaluation when taking this decision.”

While Turkey could impose limits on the use of the Incirlik base, that would hamper operations against Islamic State, which also menaces Turkey itself and has claimed responsibility for attacks including the bombing of Istanbul airport.

Turkey could also step up air strikes on PKK targets in northern Iraq. Turkish warplanes attacked Kurdish YPG fighters in northeastern Syria and Iraq’s Sinjar region late last month.

But Cavusoglu and Canikli both pointed to a diplomatic, rather than military, response to Trump’s decision.

“We are carrying out, and will carry out, all necessary diplomatic communications,” Canikli said. “Our wish is that the U.S. stops this wrong and does what is mandated by our friendship.”