By ROBERT BURNS and LOLITA BALDOR, Associated Press

WASHINGTON (AP) — Military leaders were scrambling Thursday to devise a swift but safe departure of troops from Syria, as outraged lawmakers appealed to President Donald Trump to reverse an abrupt withdrawal order that rattled Washington's allies and was a key factor in the resignation of Defense Secretary Jim Mattis later in the day.

Defense officials said U.S. airstrikes would continue until all the approximately 2,000 U.S. troops are out of Syria, but it was unclear whether the air campaign would then end. Officials said it might depend on whether France and other coalition partners keep ground troops in Syria after the Americans leave. A continued presence of allied troops working with local Syrians might compel the U.S. to contribute air cover.

The Pentagon, roiled first by the surprise withdrawal order from Trump and then the abrupt resignation of Mattis, offered no information about how the withdrawal will happen or how long it will take, apparently because they don't know.

Two officials speaking on condition of anonymity to discuss internal planning said Gen. Joseph Votel, head of U.S. Central Command, will submit a comprehensive withdrawal plan to top Pentagon officials in coming days.

One official said military commanders are concerned that the pullout will leave their Syrian Kurdish allies in the lurch.

Turkey, which considers the Kurds a security threat, has said it intends to send its army into Syria to clear them out. Until now, Turkey had to consider the presence of U.S. troops; once they are gone, a bloody clash seems inevitable.

Sen. Lindsey Graham, R-S.C., said on Thursday that Mattis had told him he is worried about the Kurds and this is not the right time to leave.

"I won't get into conversations between Mattis and the president, but I will tell you what he told me: He thought that the time was not right to leave," Graham said at a Capitol Hill news conference.

Mattis believes that "the day we leave it's going to be open season on every Kurd who's supported us," he said.

The Kurdish-led Syrian Democratic Forces, who have partnered with U.S. troops for years as the key force against IS militants, said in a strongly worded statement laced with bitterness that the fight against IS was at a "decisive" stage that requires even more support from the U.S.-led coalition.

"The war against terrorism has not ended and (the Islamic State group) has not been defeated," the statement said.

Graham said Mattis also expressed concern about the more than 700 Islamic State fighters being held by the SDF, saying they could be released and end up back on the battlefield.

The militants still hold a string of villages and towns along the Euphrates River in eastern Syria, where they have resisted weeks of attacks by the U.S.-supported Syrian Democratic Forces to drive them out. The pocket is home to about 15,000 people, among them 2,000 IS fighters, according to U.S. military estimates.

From the start of his administration, Trump had made no secret of his desire to pull out of Syria. But the timing of his announcement Wednesday remains a puzzle. His national security adviser, John Bolton, Mattis and other top leaders argued against the pullout, but were unable to change Trump's mind.

Graham and Democratic Sens. Bob Menendez of New Jersey and Jack Reed of Rhode Island say they have growing support for a resolution urging the president to change his strategy. Graham, who usually is a strong Trump supporter, has savaged the pullout decision as wrong-headed, ill-timed and a gift to America's adversaries.

"I can't explain this decision," Graham told reporters. "I'm not going to suggest motivations that are anything other than a frustrated president. But I can promise this: that if you follow through with this everything that happened in Iraq is going to happen in Syria. It's going to be worse, not better. It's going to make it harder to make the Taliban reconcile." His Taliban reference was to U.S. efforts to promote peace in Afghanistan.

On Thursday, Trump defended his decision, saying on Twitter: "Getting out of Syria was no surprise. I've been campaigning on it for years, and six months ago, when I very publicly wanted to do it, I agreed to stay longer."

He added: "Does the USA want to be the Policeman of the Middle East, getting NOTHING but spending precious lives and trillions of dollars protecting others who, in almost all cases, do not appreciate what we are doing? Do we want to be there forever?"

Mattis and other senior administration officials have argued publicly for months that it would be in the best interests of the United States to remain in Syria long enough to ensure a lasting defeat of the Islamic State militants, who have been greatly diminished but not eliminated. Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, recently said the Pentagon estimates that 35,000 to 40,000 local security forces are needed to ensure stability in northeastern Syria. As of December, Dunford said, only about 20 percent of those forces have been trained.

Secretary of State Mike Pompeo, who is known to have opposed leaving Syria now, defended the Trump decision Thursday.

"The president made an enormous commitment to take down the caliphate, and that has been achieved," he said. "We now have the battle, it's a long-time battle, which is the counterterrorism battle, not only against ISIS, but against al-Qaeda and others ..., all the terrorist groups. President Trump remains just as committed today as he was yesterday and the day before."

Trump pushed back against Graham in a tweet, writing: "So hard to believe that Lindsey Graham would be against saving soldier lives & billions of $$. Why are we fighting for our enemy, Syria, by staying & killing ISIS for them Russia, Iran & other locals?"

It's true that Syrian President Bashar Assad considers the Islamic State militants a threat, and that Assad has been supported by Iran and Russia in his civil war against a range of opposition fighters. The stated purpose of the U.S. military presence, however, was not to defend Assad but to defeat the Islamic State while pressing for a U.N.-brokered diplomatic solution to the civil war.

___

Associated Press writer Matthew Lee contributed to this report.