Washington • President Donald Trump threw Middle East policy into turmoil with a series of conflicting signals after his vow to withdraw U.S. forces from the region touched off an uprising among congressional Republicans and protests by America’s allies.

Defending his decision to clear the way for a Turkish military operation against America’s Kurdish allies in northern Syria, announced in a White House statement Sunday night, Trump said it was “time for us to get out” and let others “figure the situation out.”

But his move touched off a broad rebuke by Republicans, including some of his staunchest allies, in some of the sharpest language they have leveled against a Trump foreign policy decision. Utah’s Sen. Mike Lee was one of just two senators praising the move. In response the president pivoted sharply and said he would restrain Turkey.

“As I have stated strongly before, and just to reiterate, if Turkey does anything that I, in my great and unmatched wisdom, consider to be off limits, I will totally destroy and obliterate the Economy of Turkey (I’ve done before!),” the president wrote on Twitter. He did not explain what would be off limits, but aides insisted he had not given a green light to an invasion.

A Defense Department official said the president’s threat to destroy the Turkish economy should make clear that Trump had not approved a Turkish attack on the Kurds. “The Department of Defense made clear to Turkey — as did the president — that we do not endorse a Turkish operation in northern Syria,” Jonathan Hoffman, a Pentagon spokesman, said in a statement. “The U.S. armed forces will not support, or be involved in any operation.”

But Republicans were not sure. Even after Trump recalibrated his message, Sen. Mitch McConnell, R-Ky., the majority leader, warned against “a precipitous withdrawal” that would benefit Russia, Iran, President Bashar Assad of Syria and the Islamic State. McConnell sharply urged the president to “exercise American leadership.”

The president’s pronouncements kept supporters, foreign leaders, military officers and his own aides off balance as they tried to interpret Trump’s meaning and anticipate its consequences. The president has long agitated to get the United States out of overseas wars only to be pulled back by the national security establishment and congressional allies.

In this case, Trump seemed to be responding instinctively to an unexpected comment by President Recep Tayyip Erdogan of Turkey near the end of a telephone call on Sunday that otherwise focused on trade and defense assistance. Erdogan, who has long threatened to send troops over the border against Kurdish fighters allied with the United States, told Trump that he was finally moving forward.

Trump told Erdogan that he did not support an incursion, according to aides. But rather than hold back Erdogan anymore, Trump got off the call and promptly issued a late-night statement that he would pull out about 50 U.S. special operations troops near the border who have served as a trip wire deterring Turkey from sending forces into Syria.

By Monday morning, he was bombarded with complaints from both Republicans and Democrats, who charged that such a move would abandon the Kurds, some of the United States’ most loyal and effective allies in the region, while emboldening some of America’s most threatening enemies.

“This is a big win for Iran and Assad, a big win for ISIS,” Sen. Lindsey Graham, R-S.C., usually one of the president’s most vocal backers, said on Fox News. “I will do everything I can to sanction Turkey if they step one foot in northeastern Syria. That will sever my relationship with Turkey. I think most of the Congress feels that way.”

Graham said he would also introduce a nonbinding resolution asking Trump to reconsider his move, which he called “shortsighted and irresponsible.” The president’s assertion that the Islamic State has been defeated is “the biggest lie being told by the administration,” Graham added.

Rep. Liz Cheney of Wyoming, a member of the House Republican leadership, called withdrawing forces “a catastrophic mistake.” Sen. Marco Rubio, R-Fla., said it would be “a grave mistake that will have implications far beyond Syria.”

Sen. Mitt Romney, R-Utah, shared a tweet from Graham and added his own thoughts. “The President’s decision to abandon our Kurd allies in the face of an assault by Turkey is a betrayal,” he wrote. “It says that America is an unreliable ally; it facilitates ISIS resurgence; and it presages another humanitarian disaster.”

Nikki R. Haley, Trump’s former ambassador to the United Nations, joined the chorus. “We must always have the backs of our allies, if we expect them to have our back,” she tweeted. “The Kurds were instrumental in our successful fight against ISIS in Syria. Leaving them to die is a big mistake. #TurkeyIsNotOurFriend.”

But Utah’s Sen. Mike Lee joined Sen. Rand Paul of Kentucky, in defending the president.

“Thank you, President Trump, for withdrawing U.S. military personnel from Syria,” Lee tweeted late Monday night. “Undeclared wars are as unconstitutional as they are inadvisable. Those who disagree with this decision should ask Congress to declare war or otherwise authorize the use of military force.”

Paul, meanwhile, said the president “once again fulfills his promises to stop our endless wars and have a true America First foreign policy,” Paul tweeted.

Trump came to office promising to get the country out of overseas wars, contending that the military’s involvement in Afghanistan, Iraq and elsewhere since the Sept. 11, 2001, attacks had largely been a waste of lives and money, with little to show for it.

A similarly sudden decision last winter to pull U.S. troops out of Syria prompted Defense Secretary Jim Mattis to resign, and Brett McGurk, the special presidential envoy to the coalition fighting the Islamic State, accelerated his own planned departure in protest.

The Senate, led by McConnell, relayed its displeasure in January by voting overwhelmingly to rebuke Trump over his planned withdrawal of military forces from Syria and Afghanistan.

Trump later walked back his decision in Syria to some extent, but has been frustrated to not be doing more to extricate the United States from entanglements in the region. His supporters said that the latest move should therefore not be a surprise and that the Kurds had fair warning.

The Kurdish forces in the area, part of the Syrian Democratic Forces, or SDF, have been the most reliable U.S. allies in the region for years, a critical element in recapturing territory once controlled by the Islamic State. But Turkey has long considered the Kurdish fighters to be terrorists and has lobbied the United States to abandon support for them.

Trump’s initial messages on Monday morning focused not on holding back Turkey but on pulling back from the region.

“I held off this fight for almost 3 years, but it is time for us to get out of these ridiculous Endless Wars, many of them tribal, and bring our soldiers home,” Trump wrote. “WE WILL FIGHT WHERE IT IS TO OUR BENEFIT, AND ONLY FIGHT TO WIN. Turkey, Europe, Syria, Iran, Iraq, Russia and the Kurds will now have to figure the situation out.”

He offered little sympathy for the fate of America’s Kurdish allies: “The Kurds fought with us,” he wrote, “but were paid massive amounts of money and equipment to do so.”

Meeting with reporters later in the day, he recalled his promises to get out of Middle East wars. “I campaigned on the fact that I was going to bring our soldiers home and bring them home as quickly as possible,” Trump said.

But even as Trump talked in global terms, administration officials stressed the limited nature of the current action. Special operations troops near the border will be relocated in coming days but the total 1,000 troops in Syria would not immediately come home.

Trump has been particularly irritated that the United States continues to pay to detain thousands of Islamic State fighters captured in recent years. For months, he has tried to pressure European states and others to take those fighters who originated from there, only to run into strong resistance.

“We said, ‘Take them back’ and unfortunately, like NATO, they take advantage,” Trump told reporters.

But if Turkey moves against the Kurds, the SDF could abandon camps to fight the Turks, potentially allowing some 10,000 captured Islamic State fighters, including 2,000 foreigners, to escape. A senior administration official who briefed reporters on the condition of anonymity under administration ground rules said Trump told Erdogan that if he did send in troops, they would be responsible for securing the prisoners.

The United States has suspended long-standing efforts to create a safe zone in Syria near the Turkish border that would have kept Turkish forces and Syrian fighters at a distance from each other. But another administration official said that the United States was now controlling the air space over northeast Syria in part to prevent Turkish aggression.

The prospect that a U.S. withdrawal would lead to a Turkish incursion alarmed European allies. The French and Germans issued statements expressing deep concern. A State Department official said the international reaction to a possible Turkish operation had been “devastating” and acknowledged it would destabilize the region.

For now at least, the Syrian Defense Forces leadership has told U.S. officials that it will continue to detain the Islamic State fighters and their families in makeshift camps in northern Syria. But a State Department official acknowledged that the best-trained guards could be pulled away in the event of conflict with Turkey.

Most of the camps are farther south than where the Turkish forces have indicated they might go in Syria, outside the boundary of even the broadest safe zone that has been discussed. If the Kurdish guards flee advancing Turkish forces, the official said, then the administration expects the Turks to take over the detention centers.

U.S. counterterrorism specialists said Monday that transferring counterterrorism responsibilities to a Turkish military force that has proved ill-trained and ill-equipped to conduct such operations in their own country would be disastrous and potentially reverse important victories by U.S. troops and their Kurdish partners on the ground.

“It’s hard to imagine Turkey has the capacity to handle securely and appropriately the detainees long held by the Syrian Kurds — and that’s if Turkey even genuinely intends to try,” said Joshua A. Geltzer, a former senior director for counterterrorism at the National Security Council under President Barack Obama.

“The release or escape of such detainees,” he added, “would instantly energize ISIS’ efforts, already underway, to regroup and surge again.”

Clarification: Tuesday 4:24 p.m. This story was updated to reflect Sen. Mike Lee's support of President Trump over the withdrawal of troops.