US defence secretary Jim Mattis will now leave his post on January 1, with deputy Pentagon chief Patrick Shanahan taking over as acting secretary to cover the accelerated departure.

The move comes just three days after Mr Mattis resigned in protest over President Donald Trump’s decision to pull all US troops out of Syria and delivered a blistering letter to the president that roiled Washington and reportedly angered the White House.

Mr Mattis originally said he would stay through February to ensure an orderly transition but officials said the fallout of his decision to leave – including the shock and dismay expressed on Capitol Hill – annoyed Mr Trump and likely led to Mr Mattis leaving earlier than planned.

Lieutenant Colonel Joseph Buccino, a spokesman for Mr Shanahan, said the former Boeing executive will accept the appointment as acting secretary.

“(The) deputy secretary will continue to serve as directed by the president, and the Department of Defence will remain focused on the defence of the nation,” Mr Buccino said on Sunday.

While Mr Mattis’s resignation followed Mr Trump’s announcement he would soon pull all of the approximately 2,000 US troops out of Syria, officials said the resignation was the result of an accumulation of disagreements.

In a stunning resignation letter, Mr Mattis made clear he did not see eye-to-eye with a president who has expressed disdain for Nato and doubts about keeping troops in Asia.

Earlier on Sunday, Mr Trump’s acting chief of staff said the president had known for “quite some time now” that he and Mr Mattis “did not share some of the same philosophies … have the same world view.”

Mick Mulvaney told ABC’s This Week the president and his defence chief “just could never get on the same page” on Syria, adding Mr Trump had said since his presidential campaign that “he wanted to get out of Syria.”

Mr Mulvaney said the president “is entitled to have a secretary of defence who is committed to that same end”.

Asked whether Mr Trump wanted a Pentagon leader willing to challenge him or someone in lock step with his views, Mr Mulvaney said “a little bit of both.”