Trump decided hastily to remove Mattis in reaction to negative news coverage, according to senior administration officials, one of whom said the president was eager to retaliate against Mattis and show up the widely respected former general. Another official said Trump and other advisers suspected Mattis of being part of a campaign to stoke negative coverage about the president.

Watch more!

After canceling his Christmas trip to Florida in view of the government shutdown, Trump was marooned this weekend at the White House watching hours of cable television news shows. Advisers said he stewed over commentary hailing Mattis as heroic — a human guardrail against the president’s impulses.

Trump was so angry with Mattis that on Sunday morning he directed Secretary of State Mike Pompeo to inform the defense secretary that he was being pulled from office two months early, according to a senior administration official.

Mattis resigned in protest Thursday after Trump announced the withdrawal of U.S. troops from Syria over the strong objections of Mattis and others on the national security team. Brett McGurk, the top U.S. envoy to the international coalition fighting the Islamic State militant group, also resigned in protest over Trump’s Syria decision.

In his letter, Mattis delivered a sharp rebuke of Trump’s worldview and cast the president’s foreign policy positions as a threat to the nation. He wrote that he would leave his post on Feb. 28 to allow for a smooth transition to the next defense secretary. But Trump decided to hasten the process, announcing Sunday on Twitter that Shanahan would replace Mattis imminently.

“I am pleased to announce that our very talented Deputy Secretary of Defense, Patrick Shanahan, will assume the title of Acting Secretary of Defense starting January 1, 2019,” Trump wrote. “Patrick has a long list of accomplishments while serving as Deputy, & previously Boeing. He will be great!”

Trump’s Syria decision has emerged as a flash point in Washington, with some prominent Republican lawmakers continuing to plead with the president to change his mind.

Trump has shown no willingness to reconsider. He tweeted that he had a “long and productive” call Sunday with Turkish President Recep Tayyip Erdogan to discuss the conflict in Syria and Trump’s plans for a “slow & highly coordinated pullout of U.S. troops from the area.”

Trump’s advisers have persuaded the president to remove the troops more slowly than he would like, White House aides said, because withdrawing too quickly could jeopardize their safety. Aides also are trying to keep Trump from publicly announcing the withdrawal of troops from Afghanistan in hopes that they might moderate his decision and develop a plan.

Senate Foreign Relations Committee Chairman Bob Corker (R-Tenn.) warned Sunday that Trump was making “devastating decisions” and speculated that the Syria withdrawal could hobble his presidency.

“I think he knows he’s made a mistake. I do,” Corker said on CNN’s “State of the Union.” He added, “I think this next three months could well determine whether he decides to run again or not. I think it’s going to be very important for our country that the United States Senate really dig in and make sure we don’t make other colossal mistakes as it relates to foreign policy.”

Trump attacked Corker on Twitter a few hours later, reviving a long-running feud between the two men.

Trump found Republican support from Sen. Rand Paul (Ky.), a libertarian-leaning critic of military intervention whose position represents a minority in the party.

“I think the president is doing the best thing,” Paul said on CNN. “He said we weren’t going to be for nation-building. We’re not going to go create a nation out of that chaos of Syria or Afghanistan. We’re going to take care of things we have got here at home. And I think, actually, the people are with him.”

With Trump’s elevation of Shanahan, the list of senior officials serving on a temporary basis grows. The White House chief of staff, attorney general and Environmental Protection Agency administrator are each serving in an “acting” capacity. On Jan. 2, the Interior Department also will have an acting secretary.

Unlike Mattis, Shanahan was not in the military and has little foreign policy or government experience. Shanahan worked for decades at Boeing handling the aviation behemoth’s commercial aircraft and missile defense programs. Trump, who had complained to aides that Mattis did not share his enthusiasm for negotiating defense contracts, admires Shanahan for taking a special interest in such matters, according to a senior administration official.

Since his arrival at the Pentagon, Shanahan has emphasized making the department more efficient and business-friendly — and has won plaudits at the White House by pushing through Trump’s vision for a space force, against the wishes of many of the military’s uniformed brass.

Trump’s announcement Sunday caught top officials at the Pentagon off guard.

Shanahan was traveling when Trump tweeted his decision. A spokesman for Shanahan, Army Lt. Col. Joseph Buccino, said Sunday that he would continue to serve as directed by the president.

A spokeswoman for Mattis, Dana White, said that the outgoing secretary will focus over the next week on ensuring a smooth transition and that the Pentagon remains focused on the defense of the nation.

Mattis was due to give testimony on Capitol Hill regarding the new national security strategy, which probably would have resulted in tense questions about his resignation and differences with Trump. While Mattis still could end up testifying after leaving the Pentagon, his early dismissal by Trump reduces that chance.

The abrupt nature of Mattis’s departure raises questions about who else may leave the Pentagon in coming weeks, thrusting the department further into chaos.

Army Secretary Mark Esper, Air Force Secretary Heather Wilson and Navy Secretary Richard Spencer all have characterized their relationships with Mattis as close, and Wilson has said that she chose to serve in the administration specifically at the request of Mattis.

In his tweet last week announcing Mattis’s departure, Trump initially praised the secretary for serving “with distinction” and achieving “tremendous progress.” But as he consumed media coverage in the hours and days that followed, Trump vented to advisers about the narrative that took hold of the revered four-star Marine Corps general and military intellectual walking out on Trump because he believed the president’s erratic decisions were threatening the world order.

In recent days, Trump went so far as to tell White House aides that he does not need Mattis and that his defense secretary was not as important a figure as others believed, a senior administration official said.

Trump was not shy about sharing his frustrations publicly. On Saturday, he complained on Twitter that he was not getting enough credit for the Syria withdrawal: “If anybody but your favorite President, Donald J. Trump, announced that, after decimating ISIS in Syria, we were going to bring our troops back home (happy & healthy), that person would be the most popular hero in America. With me, hit hard instead by the Fake News Media. Crazy!”

Then the president took a shot directly at Mattis, with a bit of revisionist history. When he picked Mattis to be defense secretary before the start of his presidency, Trump showered praise on him, reveling in the general’s battlefield valor, calling him by his nickname “Mad Dog” and comparing him to the decorated World War II Army general George S. Patton.

“He is one of the most effective generals that we’ve had in many, many decades, an extraordinary leader of our time who has committed his life to his love for our country,” Trump said in a Dec. 6, 2016, speech announcing the nomination. “General Mattis is the living embodiment of the Marine Corps motto, ‘semper fidelis,’ always faithful.”

But on Saturday night, Trump tweeted, “When President Obama ingloriously fired Jim Mattis, I gave him a second chance. Some thought I shouldn’t, I thought I should. Interesting relationship-but I also gave all of the resources that he never really had. Allies are very important-but not when they take advantage of U.S.”

Former New Jersey governor Chris Christie, an informal Trump adviser, argued Sunday on ABC News’s “This Week” that nobody should be surprised by Trump’s actions because he is doing what he campaigned on. Christie, who this month took himself out of the running to be White House chief of staff, likened Trump to a “72-year-old relative” who is stubborn.

“When people get older, they become more and more convinced of the fact that what they’re doing is the right thing,” Christie said, “and it becomes harder to convince them otherwise.”