Mr. Trump’s decision to remove American forces from the region in advance of the Turkish offensive has been met with condemnation from both parties in Congress, including from some of Mr. Trump’s staunchest supporters. Senator Mitch McConnell, the majority leader, denounced the president’s move as a betrayal of American allies; so did Senator Lindsey Graham of South Carolina, who declared that “the ability to recruit partners to fight radical Islam in the future has been virtually destroyed.”

White House officials say they are concerned that lawmakers are moving forward with bipartisan sanctions legislation, which could have enough votes to override a presidential veto. That happened in 2017, involving sanctions on Russia.

It was the timing of Friday’s threat, more than the substance, that seemed particularly mysterious. In the days since President Recep Tayyip Erdogan spoke with Mr. Trump by telephone about pulling American troops out of Syria, several senior American diplomats have said that Mr. Trump made a crucial error by not threatening sanctions before the withdrawal. By doing so after the fact, Mr. Erdogan would lose face if he changed course in response to such a warning.

Nonetheless, Secretary of State Mike Pompeo, in an interview with The Tennessean during a visit to Nashville, seemed to be trying to contain the damage.

“The president’s made very clear, both publicly and directly to Turkey as well as through State Department channels, that there will be a real cost to Turkey, to President Erdogan, if he continues down this path; that there’ll be an economic cost,” he said. “But the Kurdish people here and the leadership in Turkey should understand that we don’t think what President Erdogan did was right. It’s not proper, and he needs to stop.”