President Trump sought Thursday to defend his decision to withdraw all U.S. military forces from Syria amid mounting criticism from lawmakers in both parties — and fresh praise from Russian President Vladimir Putin.

In morning tweets, Trump selectively quoted lawmakers and political pundits who agreed with him and argued that the withdrawal was the fulfillment of a campaign pledge and that the United States should not play the role of “Policeman of the Middle East.”

“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,” Trump said in his tweets, adding: “Do we want to be there forever?”

Trump said it was time for others in the region to step up against the Islamic State terrorist group and other hostile forces. “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?” he asked.

His tweets came a day after Trump justified pulling out of Syria by claiming that the United States had defeated the Islamic State, an assertion that was widely criticized as premature, risking future aggression in the absence of U.S. forces.

The move plunged U.S. allies into uncertainty and created the potential for greater regional instability even as it provided Russia and its ally, Syrian President Bashar al-Assad, a chance to cement greater control over the country amid a civil war.

Some of the most persistent criticism of Trump’s move came Thursday from Sen. Lindsey O. Graham (R-S.C.), an ally of the president on most issues.

Graham, who earlier called Trump’s decision “a disaster,” drafted a nonbinding resolution for the Senate to call on Trump to reconsider his decision and for any future decision to withdraw to come only after a “robust interagency process” — implicit criticism of Trump’s lack of consultation before Wednesday’s announcement.

“I think there’s a lot of votes for it,” Graham said at a news conference, adding that he was confident Trump had not consulted senior members of his national security team before making his decision.

“Only in President Trump’s parallel alternate universe has ISIS been defeated,” said Sen. Robert Menendez (D-N.J.), the top Democrat on the Senate Foreign Relations Committee, who appeared alongside Graham at the news conference on Capitol Hill.

During a separate news conference, House Minority Leader Nancy Pelosi (D-Calif.) criticized Trump for making his decision in “a cavalier fashion,” calling it “a Christmas present to Vladi­mir Putin.”

As Trump was tweeting from the White House, Putin, at his annual year-end news conference, said the Islamic State has suffered “serious blows” in Syria and praised Trump’s decision to withdraw U.S. forces.

“On this, Donald is right. I agree with him,” Putin said.

Russia — Assad’s most powerful ally — turned the tide in the civil war in Assad’s favor and has maintained a military presence there.

In one of his tweets, Trump quoted two Republican lawmakers who agreed with his decision, Sens. Rand Paul (Ky.) and Mike Lee (Utah).

“I’m proud of the President today to hear that he is declaring victory in Syria,” Trump quoted Paul as saying. “I couldn’t agree more with the president’s decision,” Trump quoted Lee as saying.

He made no mention of criticism coming from Capitol Hill, including a letter sent Wednesday by a bipartisan group of six senators, including Graham. The letter asked Trump to reconsider, warning that withdrawing U.S. troops from Syria would “renew and embolden” the Islamic State, also known as ISIS, in the Middle East.

Graham continued to raise objections to the move Thursday, disputing Trump’s assertion that others in the region could continue the fight against ISIS.

“When it comes to fighting ISIS I do not believe it is wise to outsource the fight to Russia, Iran, and Assad,” Graham wrote on Twitter. “They do not have America’s best interests at heart.”

Later Thursday, Trump fired back at Graham.

“So hard to believe that Lindsey Graham would be against saving soldier lives & billions of $$$,” Trump said in a tweet. “Why are we fighting for our enemy, Syria, by staying & killing ISIS for them, Russia, Iran & other locals? Time to focus on our Country & bring our youth back home where they belong!”

Sen. Chris Murphy (D-Conn.),meanwhile, questioned how Trump could assert Wednesday that the Islamic State has been defeated while saying in his tweets on Thursday that others in the region would now have to fight the terrorist group without the United States.

“But wait a minute . . . I thought we defeated ISIS,” Murphy tweeted. “Why would Russia, Iran and Syria have to fight them if they’re defeated?”

During a morning television appearance, House Minority Whip Steny H. Hoyer (D-Md.) called Trump’s decision “impulsive, irresponsible and dangerous.”

“I would hope that the president would reconsider,” Hoyer said on CNN. “The only people happy today about this decision are, in my opinion, the Syrians, the Iranians, the Russians and ISIS and its allies. It was a terrible decision that puts our country in a bad spot.”

“It encourages ISIS; it doesn’t defeat ISIS,” Hoyer added.

In his tweets, Trump seemed to dismiss such concerns, writing: “I am building by far the most powerful military in the world. ISIS hits us they are doomed!”

As part of his defense of his decision, Trump quoted Fox News host Laura Ingraham in an earlier tweet, posted shortly after midnight, saying that Trump “gets no credit” for his efforts in the Middle East.

“So true, thank you Laura!” Trump added in his own words.

But such praise was hardly universal from usually Trump-friendly pundits.

On Thursday morning on Fox News, “Fox & Friends” host Brian Kilmeade ripped into the decision, calling it a “stunning and irresponsible move.”

“Nobody thinks ISIS is defeated,” Kilmeade told viewers.

Robert Costa and Timothy Bella in Washington and Anton Troianovski in Moscow contributed to this report.