President Trump accused the news media of inaccurately reporting “my intentions on Syria.” (Jabin Botsford/The Washington Post)

President Trump vowed a “prudent” withdrawal of U.S. troops from Syria, embracing a new, more cautious timeline on Monday while appearing to deny that he had ever ordered an immediate troop departure in the first place.

“We will be leaving at a proper pace while at the same time continuing to fight ISIS and doing all else that is prudent and necessary!” Trump said in a morning tweet. That was “no different from my original statements,” he said, accusing the news media of in­accurately reporting “my intentions on Syria.”

Last month, Trump declared the Islamic State defeated in Syria and said troops would be “coming back now.” Since then, senior officials have issued a series of statements that have cast doubt on his promise of a quick departure.

The president’s endorsement of a flexible departure, conditioned on the still-to-come defeat of the Islamic State, was the latest indication of his administration’s zigzagging foreign policy, in which decisions are often made by dramatic presidential tweets and followed by more-circumspect policies reflecting top advisers’ views.

The initial plan for a quick withdrawal, which would require turning over the U.S.-supported effort against remaining militants to NATO ally Turkey, was met with dismay among officials and lawmakers who feared the Islamic State could return in force. A day after Trump’s announcement, ­Defense Secretary Jim Mattis resign­ed in protest.

Trump’s new remarks appeared to endorse a revised proposal, floated by national security adviser John Bolton a day earlier, that would allow U.S. troops and their local allies to extinguish a small but stubborn militant force before they depart. It would also require Turkey to refrain from attacking Syrian Kurdish troops who are the chief U.S. partner on the ground.

The evolving plans came as Bolton traveled Monday to Ankara, Turkey’s capital, for talks with Turkish officials on the U.S. withdrawal, including protection of the American-allied Syrian Democratic Forces (SDF), which Turkey has vowed to expel from northeast Syria. He was expected to be joined by Gen. Joseph F. Dunford Jr., chairman of the Joint Chiefs of Staff.

Officials across the government have scrambled in recent days to keep up with shifting statements from administration leaders, even as they continued to make plans for a near-term military exit that they cautioned could squander the fruits of a four-year military effort.

While Trump initially demanded a 30-day departure, officials said the administration later settled on an exit within 120 days to give troops more time to break down bases and safely remove equipment and personnel. The latest comments from Trump and Bolton intensified questions about what would occur concerning the more than 2,000 U.S. troops in Syria.

Joshua Geltzer, who served as a White House counterterrorism official during the Obama administration, said the back-and-forth was an obstacle for diplomats and military planners.

“It’s hard enough to plan military operations when there’s a clear sense of the assets and resources available. It’s even harder with this persistent uncertainty,” said Geltzer, who is now at the Georgetown University Law Center.

Trump’s pullout plan fueled concerns among allied nations, including France and Britain, which have sent their own troops to Syria. It also drew criticism from some in his own party, including Sen. Lindsey O. Graham (R-S.C.), who on Sunday said Trump had “made a mistake” with his initial pronouncement but was now “slowing down.”

On Monday, the new chairman of the House Armed Services Committee accused Trump of “changing course like a drunken sailor.”

“It shows that our president literally doesn’t know what he is doing. He is making it up as he goes,” Rep. Adam Smith (D-Wash.) told CNN. “The way he is going about it is disastrous.”

But Trump and his top advisers were defiant Monday as they denied that their Syria plans had changed.

“The Failing New York Times has knowingly written a very in­accurate story on my intentions on Syria,” Trump said in the same tweet, referring to articles on Sunday from numerous publications, including the Times and The Washington Post, that noted the shifting accounts of the military exit. “No different from my original statements.”

Trump kicked off weeks of confusion with his declaration last month, bucking the advice of top advisers who urged patience as U.S. and allied troops sought to eradicate remaining militants. Since he was a candidate, Trump has vowed to end the Syria mission.

“Our boys, our young women, our men, they’re all coming back and they’re coming back now. We won,” Trump said in a Dec. 19 video message on Twitter.

More recently, Trump and other senior officials have backed away from asserting victory over the Islamic State, as the military continues to conduct hundreds of airstrikes against a still-potent militant force.

Secretary of State Mike Pompeo, who is also traveling to the Middle East this week, said Monday that “there is no change” in the administration’s commitment to defeating the Islamic State or countering Iranian influence in Syria.

“It’s a change in tactics,” Pompeo said in an interview with CNBC. “We’re going to withdraw our 2,000 soldiers from Syria, but the mission . . . remains in full,” with some activities being carried out by “allies.”

Military officials are awaiting decisions from Trump and others about the withdrawal, including whether the United States will continue its air campaign in Syria and how the administration plans to position Special Operations forces to enable periodic missions against militant leaders.

“We’ve seen a slight exhale among those in the Pentagon who were worried about planning and executing a withdrawal,” said Mara Karlin, a professor at the Johns Hopkins School of Advanced International Studies who previously served as a senior Pentagon official.

In an opinion piece published Monday by the New York Times, Turkish President Recep Tayyip Erdogan promised that his nation would fill the gap left by the United States. He noted that Turkey, unlike the United States, had sent ground troops several times to directly battle the Islamic State in northern Syria.

Erdogan voiced support for an American exit but said it should be “planned carefully and performed in cooperation with the right partners to protect the interests of the United States, the international community and the Syrian people.”

“Turkey, which has NATO’s second largest standing army, is the only country with the power and commitment to perform that task,” he wrote.

Under the earlier White House plans, Turkish-backed forces would press into areas now controlled by the SDF, a notion that American officials have cautioned could lead to deadly Turkish-Kurdish battles.

Erdogan, who has called the SDF a terrorist group, has vowed to send his own troops, along with allied Syrian fighters, across the border to push out the SDF. Bolton’s revised plan appears to link the U.S. withdrawal to Turkish guarantees to refrain from such an incursion.

Trump, who has rarely mentioned the Kurdish fighters, last week said, “We want to protect the Kurds, but I don’t want to be in Syria forever. It’s sand. And it’s death.” Bolton, during a weekend stop in Israel, said the United States wanted to ensure that the Kurds were not put in “jeopardy” by the U.S. withdrawal.

Hours before Bolton’s arrival in Ankara, Turkish Defense Minister Hulusi Akar insisted that Turkey’s problem was not with Kurds in general but with those belonging to the People’s Protection Units, or YPG. “The fight of the Turkish armed forces is not against our Kurdish brothers, with whom we have shared the same geography and the same bread for centuries,” Akar said.

The Kurdish ethnic group is spread across a contiguous area that includes portions of Turkey, Syria, Iraq and Iran. In Turkey, a Kurdish group allied with the ­Syrian YPG has fought for autonomy for decades.

But YPG fighters make up the bulk of the SDF, which the United States has trained, armed and advised as the primary ground force against the Islamic State in Syria. As northeastern Syria has been cleared of the militants, the Kurds have set up a provisional government that now borders Turkey.

The YPG has been in contact with both Syrian President Bashar al-Assad’s government and with Russia, Assad’s primary backer, as a backstop against a U.S. withdrawal.

With the administration scrambling to present an organized approach to a pullback and vowing that it will protect its allies, both Turkey and Israel now appear to believe they have some leverage.

In addition to demanding that the administration sever its alliance with the Kurdish fighters — or at least move them from the border and downgrade their influence in eastern Syria — Ankara plans to ask for U.S. air and logistical support in exchange for fighting against remaining Islamic State militants.

Israel, which has launched repeated airstrikes into Syria against Iranian-backed Hezbollah forces allied with Assad, appealed to Bolton to compensate for the pullout by recognizing its sovereignty over the Golan Heights as a buffer zone against Iranian expansion. The plateau was captured from Syria during the 1967 Six-Day War by Israel, which later effectively annexed it. Syria has consistently demanded its return, and the Israeli occupation has never been recognized by the international community.

In another twist, Bolton also suggested that the United States might not withdraw all its forces after all, and instead could leave some at a garrison in southeast Syria.

The tiny, remote base, Tanf, is on a key ground route from Tehran to Damascus and has been seen as an important tool in constraining Iran’s expansion in Syria. It remained unclear whether Trump supported keeping troops there.

Paul Sonne contributed to this report.