President Trump said on Sunday that he would remove Defense Secretary Jim Mattis, who issued a stinging rebuke of the president when he announced his resignation last week, from his post by Jan. 1, two months before he had planned to depart.
Mr. Trump, in a Twitter post, said that Patrick M. Shanahan, Mr. Mattis’s deputy, would serve as the acting defense secretary.
Aides said that the president was furious that Mr. Mattis’s resignation letter — in which he rebuked the president’s rejection of international allies and his failure to check authoritarian governments — had led to days of negative news coverage. Mr. Mattis resigned in large part over Mr. Trump’s hasty decision to withdraw American forces from Syria.
When Mr. Trump first announced that Mr. Mattis was leaving, effective Feb. 28, he praised the defense secretary on Twitter, saying he was retiring “with distinction.” One aide said that although Mr. Trump had already seen the resignation letter when he praised Mr. Mattis, the president did not understand just how forceful a rejection of his strategy Mr. Mattis had issued.
The president has grown increasingly angry as the days have passed, the aide said. On Saturday, Mr. Trump posted a tweet that took a jab at Mr. Mattis, saying that “when President Obama ingloriously fired Jim Mattis, I gave him a second chance. Some thought I shouldn’t, I thought I should.”
Mr. Mattis, a retired four-star general, led the United States Central Command, which oversees military operations in the Middle East and Southwest Asia, from 2010 to 2013. His tour there was cut short by the Obama administration, which believed he was too hawkish on Iran.
Mr. Shanahan, who, like Mr. Mattis, is from Washington State, is a former Boeing executive. Aides say that Mr. Trump likes him in part because he often tells the president that he is correct to complain about the expense of defense systems.