Donald Trump is forcing his defence secretary James Mattis to step down on 1 January, almost two months ahead of schedule, with the president seemingly weary of the criticism he has faced over Mr Mattis’ departure.

The move appears to be payback for the public rebuke the retired general gave the president in his resignation letter over Mr Trump’s decision to withdraw US troops from the conflict in Syria. Not least because Mr Trump tried to portray Mr Mattis leaving as a “retirement” when the letter released shortly after the announcement made it clear that was not the case.

Mr Trump issued the news in typical fashion, via Twitter. The president said that Patrick Shanahan, the current deputy at the Department of Defence, would become acting head of the Pentagon from the start of the new year.

Praising the “long list of accomplishments” of Mr Shanahan, without mentioning any in particular, and calling him “very talented”, Mr Trump did bring up his business background at Boeing. Mr Shanahan had a long history with the company before joining the administration in 2017.

Mr Trump has clearly been stewing over Mr Mattis’ resignation letter – which laid out a departure date of 28 February – over the weekend. He has faced a backlash from both Republicans and Democrats over the loss of Mattis at the end of a week where the White House has never looked more chaotic.

As well as losing two national security officials, the stock market is on track for its worst month since the 1930s. That is a source of embarrassment for the president given that much of the praise he has received during his time at the White House has been linked to the rising markets and the economy in general.

Mr Trump has also had to watch as the New York attorney general announced the fact his charitable Trump Foundation will be dissolved, while special counsel Robert Mueller’s investigation into Russian election meddling in 2016 and any possible collusion with the Trump campaign is still circling the president.

A number of tweets from the president over the weekend referenced the Syria decision and the fact that Mr Trump is also seeking to withdraw thousands of troops from Afghanistan.

In particular, on Sunday, Mr Trump tried to point towards the bills he signed this week, one on agriculture and the other a rare bipartisan victory in regards to prison reform, but he said that “all the Fake News Media wants to talk about is ‘the mistake’ of bringing our young people back home from the Never Ending Wars. It all began 19 years ago!”.

Who could be running against Trump in 2020? Show all 23 1 /23 Who could be running against Trump in 2020? Who could be running against Trump in 2020? Joe Biden The former vice president - poised to be a frontrunner - has announced his run. He recently faced scrutiny for inappropriate touching of women, but was thought to deal with the criticism well AFP/Getty Who could be running against Trump in 2020? Bernie Sanders The 2016 runner-up has announced that he will be running again in 2020 Getty Who could be running against Trump in 2020? Hillary Clinton The 2016 Democratic presidential candidate and former Secretary of State says she is “still considering” whether she will run again. Getty Who could be running against Trump in 2020? Pete Buttigieg The Indiana mayor and war veteran will be running for president. If elected, he would be the first openly LGBT+ president in American history. Getty Who could be running against Trump in 2020? Kamala Harris The former California attorney general will be running for president in 2020. Introduced to the national stage during Jeff Sessions’ testimony, she has endorsed Medicare-for-all and proposed a major tax-credit for the middle class. AP Who could be running against Trump in 2020? Elizabeth Warren The Massachusetts Senator has formally launched her bid for president in 2020. A progressive Democrat, she is a major supporter of regulating Wall Street. AP Who could be running against Trump in 2020? Beto O’Rourke The former Texas congressman told Oprah Winfrey that he “has been thinking about running for presidency”, but stopped short of formally announcing his bid to run in 2020. AFP/Getty Who could be running against Trump in 2020? Wayne Messam Mayor of the city of Miramar in the Miami metropolitan area, Wayne Messam has announced his bid. He intends to run on a progressive platform against the "broken" federal government. He favours gun regulations and was a signatory to a letter from some 400 mayors condemning President Trump's withdrawal from the Paris Climate Accord. Vice News Who could be running against Trump in 2020? Kirsten Gillibrand The New York Senator formally announced her presidential bid in January, saying that “healthcare should be a right, not a privilege.” Getty Who could be running against Trump in 2020? Cory Booker The New Jersey Senator has announced that he will be running for the presidency in 2020. If he secures the nomination he said finding a female vice president would be a priority. Getty Who could be running against Trump in 2020? John Delaney The Maryland congressman was the first to launch his bid for presidency, making the announcement in 2017. AP Who could be running against Trump in 2020? Julian Castro The former San Antonio mayor announced his candidacy in January and said that his running has a “special meaning” for the Latino community in the US. Getty Who could be running against Trump in 2020? Tulsi Gabbard The Hawaii congresswoman announced her candidacy in January, but is likely to face tough questions on her past comments on LGBT+ rights and her stance on Syrian President Bashar al-Assad. Getty Who could be running against Trump in 2020? Andrew Yang The entrepreneur has announced his presidential candidacy, and has pledged that he would introduce a universal basic income of $1,000 a month to every American over the age of 18. AFP/Getty Who could be running against Trump in 2020? Marianne Williamson The author and spiritual advisor has announced her intention to run for president. She had previously run for congress as an independent in 2014 but was unsuccessful. Getty Who could be running against Trump in 2020? John Kerry The former secretary of state has said he is still thinking about whether to run. Getty Who could be running against Trump in 2020? Michael Bloomberg The entrepreneur and former New York mayor– with a net worth of around $50bn – has said he will decide by the end of February whether to seek the presidency. AFP Who could be running against Trump in 2020? Howard Schultz Former Starbucks CEO Howard Schultz has not yet ruled out running for president in 2020, despite criticism that his bid could help re-elect Mr Trump by dividing the Democrat vote. AP Who could be running against Trump in 2020? Eric Holder The former attorney general has said he will decide in “the next month or so” whether to run as a 2020 presidential candidate. AP Who could be running against Trump in 2020? Eric Swalwell The California congressman said he is “ready to do this” and will decide before April whether to run. MSNBC Who could be running against Trump in 2020? Terry McAuliffe The former Virginia governor, who worked to elect Democratic governors during 2018 midterms, said there was a “50 per cent” chance he would run. AP Who could be running against Trump in 2020? Sherrod Brown The Ohio senator is still undecided about whether to run for president in 2020. Who could be running against Trump in 2020? Mitch Landrieu The former New Orleans mayor said he doesn’t think he will run for president, but “never say never”. AP Photo/Jacquelyn Martin

On Saturday night he tweeted that Mr Mattis had been “ingloriously fired” by former president Barack Obama and said he had given Mr Mattis a second chance. Mr Obama removed Mr Mattis as head of US Central Command in 2013.

In his own letter announcing his resignation last week, Mr Mattis suggested he and the president did not see eye-to-eye on foreign policy initiatives and in the way Mr Trump treats foreign allies.

“Because you have the right to have a secretary of defence whose views are better aligned with yours... I believe it is right for me to step down from my position,” he said.

Mr Mattis disagreed with the president’s decision to move forward with the troop withdrawal from Syria, and had argued that the mission against Isis in the country is not yet over. He had tried to tell Mr Trump that withdrawing the American presence from the country would only lead to more chaos in the Middle East.

In his resignation letter Mr Mattis emphasised the importance of standing up for allies, in an implicit criticism of the president.

“One core belief I have always held is that our strength as a nation is inextricably linked to the strength of our unique and comprehensive system of alliances and partnerships,” Mr Mattis wrote. “While the US remains the indispensable nation in the free world, we cannot protect our interests or serve that role effectively without maintaining strong alliances and showing respect to those allies.”

As well as making clear the importance of America’s allies, Mr Mattis called on Mr Trump to be “resolute and unambiguous” with nations like China and Russia who “want to shape a world consistent with their authoritarian model”.

“That is why we must use all the tools of American power to provide for the common defence,” Mr Mattis wrote.

The exit of Mattis, highly regarded by Republicans and Democrats alike, added to concern from congress and international allies over what they see as Mr Trump’s unpredictable go-it-alone approach to global security.

Support free-thinking journalism and attend Independent events

This impression was not helped by the resignation of US envoy Brett McGurk, who is the bridge between the United States and the international coalition fighting Isis, who himself is standing down early in the wake of the Syria decision. Mr McGurk has also made clear he believes the fight against Isis is not finished and called Mr Trump’s troop decision a “shock”.

A senior White House official said that Mr Trump was annoyed by the attention given to Mr Mattis’ resignation letter.

“He just wants a smooth, more quick transition and felt that dragging it out for a couple of months is not good,” the official said, on condition of anonymity.

The official said Mr Trump was expected to pick a nominee for defence secretary over the next couple of weeks.

Mr Shanahan, in his job as deputy defence secretary, has largely focused on internal Pentagon reform and more long-term projects like the creation of a US Space Force – a pet project for the president and vice president Mike Pence.

Defence Department spokesperson Dana White said Mr Mattis would work with Mr Shanahan and Pentagon leadership to ensure the department “remains focused on the defence of the nation during this transition”.