U.S. President Donald Trump threatened Turkey with economic devastation if it attacks a U.S.-allied Kurdish militia in Syria.

“Will attack again from existing nearby base if it reforms. Will devastate Turkey economically if they hit Kurds. Create 20 mile safe zone…Likewise, do not want the Kurds to provoke Turkey,” Trump wrote on Twitter.

“Mr @realDonaldTrump It is a fatal mistake to equate Syrian Kurds with the PKK, which is on the U.S. terrorists list, and its Syria branch PYD/YPG,” spokesman Ibrahim Kalin wrote on Twitter.

“Terrorists can’t be your partners & allies. Turkey expects the U.S. to honour our strategic partnership and doesn’t want it to be shadowed by terrorist propaganda,” he said on Monday.

Trump gave no details about the safe zone proposal.

He announced last month he would withdraw U.S. forces from Syria, declaring they had succeeded in their mission to defeat the Islamic State group and were no longer needed.

The threat weakens the Turkish lira and prompting sharp criticism from Ankara on Monday.

Relations between the two NATO allies have been strained over U.S. backing for the Kurdish YPG, which Turkey views as an extension of the outlawed Kurdistan Workers Party (PKK).

The PKK is waging decades-long insurgency on Turkish soil.

A diplomatic crisis last year, when Trump imposed sanctions on two of President Tayyip Erdogan’s ministers and raised tariffs on Turkish metal exports, helped push the Turkish lira to a record low in August.

Trump said on Sunday the U.S. was starting the military pullout from Syria which he announced in December but that it would continue to hit Islamic State fighters there.

However, U.S. officials have given mixed messages since then.

The U.S.-led coalition said on Friday it had started the pullout but officials said later it involved only equipment, not troops.

Turkish Foreign Minister Mevlut Cavusoglu said Ankara was not against the idea of a “secure zone” along the border, but added that strategic partners and allies should not communicate over social media.

“Nothing can be achieved by threatening Turkey economically.

“We need to look at how we can coordinate together and how we can solve this,” he said in a news conference with Luxembourg’s foreign minister.

The Kurdish YPG has been a U.S. ally in the fight against the jihadists and it controls swaths of Northern Syria.

Erdogan has vowed to crush it in the wake of Trump’s decision to pull U.S. troops out of the region.

Erdogan’s communications director Fahrettin Altun said: “Turkey will continue its anti-terror fight decisively” and that it was a protector of the Kurds, not their enemy.

“Terror is terror and it must be eradicated at its source. This is exactly what Turkey is doing in Syria,” he wrote on Twitter.

Turkey has swept YPG fighters from Syria’s Afrin region and other areas West of the Euphrates river in military campaigns over the past two years.

It is now threatening to strike East of the river, which it has avoided until now – partly to avoid direct confrontation with U.S. forces.

An official from the U.S.-backed Syrian Democratic Forces, a coalition of militias led by the YPG, said on Sunday Islamic State militants were “living their final moments” in the last enclave they hold near the Iraqi border.