Under fire from Republicans on two fronts, President Trump on Thursday hit back at his critics and defended his brass-rattling decision to pull troops out of Syria -- as well as his move opening the door to a government spending package that does not include new funding for his long-promised border wall.

Both developments have thrust the president into a storm of controversy within his own party, with hawkish Republicans warning that the Syria pullout could embolden ISIS and border security-minded conservatives openly fretting that they will lose leverage in the fight for a wall if Trump doesn't play hardball this week.

Trump, though, stood firmly by his Syria decision, reminding his detractors that he campaigned on withdrawing U.S. forces from their "Policeman" role in the Middle East.

CLICK HERE TO GET THE FOX NEWS APP

“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. Russia, Iran, Syria & others are the local enemy of ISIS. We were doing there [sic] work. Time to come home & rebuild. #MAGA,” Trump tweeted early Thursday.

“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? Time for others to finally fight,” he continued. “Russia, Iran Syria & many others are not happy about the U.S. leaving, despite what the Fake News says, because now they will have to fight ISIS and others, who they hate, without us.”

He added: “I am building by far the most powerful military in the world. ISIS hits us they are doomed!”

The president’s tweets come after U.S. officials first revealed Wednesday the administration was considering pulling all 2,000 American troops on the ground in Syria.

The U.S. first deployed troops to Syria in 2015 during the Obama administration as part of a partnership with Kurdish-led forces against ISIS. Multiple officials told Fox News on Wednesday that Pentagon officials were caught off guard by the White House proposal.

Numerous congressional Republicans blasted the president and compared the move to former President Barack Obama’s decision to withdraw all U.S. troops from Iraq in 2011.

“Recent history is wrought with the kind of outcomes that happen when you just precipitously wake up one day and decide you’re going to do something,” Senate Foreign Relations Committee Chairman Bob Corker, R-Tenn., told reporters. “I’ve never seen a decision like this since I’ve been here –12 years—where nothing is communicated in advance and all of a sudden this type of massive decision takes place.”

Corker said that “in many ways” Trump’s decision was worse than Obama’s 2011 move, saying that “here we’re in a situation where we’re very close in the Euphrates River Valley to finishing clearing out [ISIS].” Obama’s Iraq withdrawal is frequently blamed for creating a vacuum that allowed ISIS to gain a foothold in the region.

Sen. Lindsey Graham, R-S.C., called the move “Obama-like.”

“My theory is that by pulling 2,200 out in Northeastern Syria, that’s going to boost ISIS’ ability to come back,” Graham told Fox News. “But even more than that, the Kurds in Syria, who came forward when nobody else would to help us fight ISIS, fought bravely and died in large numbers, they’re going to feel abandoned.”

CORKER, GRAHAM SLAM TRUMP OVER DECISION TO PULL TROOPS OUT OF SYRIA 

Not all Senate Republicans disapproved of the decision. Sen. Rand Paul, R-Ky., said on the Senate floor Wednesday that he was “proud” of the president.

“Most of the voices around here like to stay everywhere for all time, and they believe that it doesn’t work unless you go somewhere and stay forever,” Paul said. “The president has the courage to say, ‘We won in Syria, and we’re coming home.’ First president in my lifetime to really do that.”

Trump highlighted the praise in another Thursday tweet.

Earlier, the White House pushed back on the claim that this could mark the end of the campaign in Syria, saying the U.S. was transitioning “to the next phase of this campaign."

“The United States and our allies stand ready to re-engage at all levels to defend American interests whenever necessary, and we will continue to work together to deny radical Islamist terrorists' territory, funding, support, and any means of infiltrating our borders,” Press Secretary Sarah Sanders said in a statement.

Meanwhile, Trump is grappling with how to keep the government running past a Friday deadline while also fulfilling his campaign promises on border security. He had demanded $5 billion for a border wall in the next budget package, but has appeared to open the door to a compromise with Democrats in order to avert a shutdown. The Senate on Wednesday passed a short-term spending package that includes a total of $1.6 billion for border security and funds other agencies at current levels through Feb. 8. The package does not include new money for a wall.

In response, House conservatives have appealed to Trump not to support the measure.

Rep. Mark Meadows, R-N.C., the leader of the conservative House Freedom Caucus, said Trump's supporters are "ready to fight on behalf of all the freedom-loving Americans to make sure we have secure borders.

"Mr. President, we’re going to back you up," Meadows said. "If you veto this bill we’ll be there. But more importantly the American people will be there. They’ll be there to support you. Let’s build the wall and make sure that we do our job in Congress."

But conservative talk show hosts like Rush Limbaugh lit into Trump over Wednesday's developments, claiming that giving ground here would give Democrats the upper hand going forward. Democrats will take control of the House in January, making any future efforts to secure wall funding even more complicated.

On Thursday, Trump touted the efforts made by Border Patrol to hold back the recent migrant caravans, while signaling the fight on border security is not over.

"With so much talk about the Wall, people are losing sight of the great job being done on our Southern Border by Border Patrol, ICE and our great Military. Remember the Caravans? Well, they didn’t get through and none are forming or on their way. Border is tight. Fake News silent!" he tweeted.

He also warned Democrats that he would demand border security funding in future bills.

The White House appears to be resolved at this stage to not getting the wall funding they want in the current budget standoff -- however, officials are aggressively looking elsewhere, including the military construction budget, to find funding. One White House official told Fox News they believe they can find $5 billion in existing appropriations that can be reallocated to build the wall.

“We have other ways that we can get to that $5 billion that we’ll work with Congress,” Sanders told Fox News on Tuesday.

Fox News’ Adam Shaw, Samuel Chamberlain, John Roberts, Lucas Tomlinson and The Associated Press contributed to this report.