WASHINGTON — Just days after Defense Secretary Jim Mattis announced he would step down from that post in late February, President Donald Trump announced he would push the popular Cabinet member out even earlier.

In a tweet Sunday morning, Trump announced that Deputy Secretary of Defense Patrick Shanahan will become acting secretary of defense starting Jan. 1. He praised the Pentagon’s second-in-command as having “a long list of accomplishments” and added, “He will be great!”

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. Patrick has a long list of accomplishments while serving as Deputy, & previously Boeing. He will be great! — Donald J. Trump (@realDonaldTrump) December 23, 2018

The move cuts short Mattis’ tenure by two months, and adds to an acrimonious end of the relationship between the commander in chief and his top military leader.

On Thursday, Mattis in a resignation letter told Trump he was making the move to allow the president to find “a secretary of defense whose views are better aligned with yours.”

He said his February departure date was designed to minimize disruption on the department during the leadership transition.

Shanahan poised to rewire the Pentagon with Mattis out Deputy Secretary of Defense Patrick Shanahan could suddenly find himself in the spotlight, following Defense Secretary Jim Mattis' announced departure.

But Mattis’ criticism of Trump’s national security policies in the letter — in opposition to his announced withdrawal of U.S. forces from Syria and his past negative comments towards U.S. foreign allies — clearly irked Trump, leading to the early dismissal.

× Fear of missing out? Sign up for the Early Bird Brief - a daily roundup of military and defense news stories from around the globe. Thanks for signing up. By giving us your email, you are opting in to the Early Bird Brief.

On Saturday, Trump appeared to fire back at Mattis on social media, tweeting that “when President Obama ingloriously fired Jim Mattis, I gave him a second chance. Some thought I shouldn’t, I thought I should.”

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. — Donald J. Trump (@realDonaldTrump) December 23, 2018

In a statement after Sunday’s announcement, Defense Department spokesman Army Col. Rob Manning said only that “the secretary of defense serves at the pleasure of the president. The department remains focused on national security.”

Mattis remains popular among lawmakers on Capitol Hill and the armed forces. A Military Times poll conducted in late September found that nearly 84 percent of troops had a favorable view of his work leading the armed forces. Among officers, the figure was almost 90 percent.

play_circle_filled Support for Trump is fading among active-duty troops, new poll shows A new Military Times poll shows that troops today are evenly split in their views about President Trump.

But Mattis’ relationship with Trump had appeared to sour in recent months as the president pushed for more aggressive military policies.

Pentagon officials appeared caught unaware by sudden decisions made in the Oval Office on forming a new Space Force, sending troops to the southern U.S. border, and banning transgender recruits from the ranks.

Most recently, Trump’s decisions to begin massive troop withdrawals in the Middle East and Afghanistan seemed to go against military commanders’ advice.

Shanahan, who is among the candidates to permanently replace Mattis, is now in a position to drive changes he's championed as Mattis' deputy.

The former Boeing executive in his current role has pushed for systemic changes to the acquisition system that pushes the Pentagon's focus away from annual budget cycles and more on making programs successful.

Read Defense Secretary Mattis’ resignation letter Defense Secretary Jim Mattis will step down at the end of February.

“Too often we focus on process, or budget, or level of effort,” Shanahan told Defense News in an earlier interview. “The Pentagon should focus on outcomes and outputs — our performance. This focus on performance should drive us to field unmatched lethality, execute on our modernization plans and achieve this affordably.”

He has also focused on eliminating duplicative programs — for example, situations where the Army and Air Force both have a need for a similar system and develop unique solutions on their own, rather than joining up and creating a single system that can be used department-wide.

In the past, services have pushed back on that idea because of the unique needs of, say, a Navy system designed to go to sea and survive the elements and sea-salt air, or an Army system designed to work on land.

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! — Donald J. Trump (@realDonaldTrump) December 23, 2018

Shanahan has risen to the top of the list of likely successors to permanently replace the now-fired Mattis, partly because of his business background and good relationships with both Trump and Vice President Mike Pence.

But Shanahan has clashed with some in the Pentagon who say he’s is too focused on having meetings, sucking up staff time without having many concrete victories to point to, according to officials who have worked with him who spoke to Defense News.

Reporter Aaron Mehta contributed to this story.