The move comes three days after Jim Mattis resigned over Trump's less interventionist policy in the Middle East.

President Donald Trump gestures while speaking during his meeting with members of his cabinet in Cabinet Room of the White House in Washington on  July 18, 2018. Looking on is Deputy Secretary of Defense Patrick Shanahan.
President Donald Trump gestures while speaking during his meeting with members of his cabinet in Cabinet Room of the White House in Washington on July 18, 2018. Looking on is Deputy Secretary of Defense Patrick Shanahan. (Reuters)

Donald Trump on Sunday announced he would replace Defense Secretary Jim Mattis with his deputy Patrick Shanahan, days after the outgoing Pentagon chief quit while citing key policy differences with the US president, notably on Syria.

Mattis, 68, had said he would leave at the end of February to allow a smooth transition for the next chief of the world's top military power but Trump sped the process amid reports that he was upset over media coverage of the stinging resignation letter submitted by Mattis.

The announcement that Mattis would leave the administration came just after Trump stunned Washington and a few militias abroad in declaring that US troops would leave Syria and significantly withdraw from Afghanistan.

Mattis and others had strongly counselled the often impulsive president against those moves.

"Because you have the right to have a secretary of defense whose views are better aligned with yours," Mattis, a retired military general, said in the letter, "I believe it is right for me to step down from my position."

Shanahan spent over three decades working for aircraft giant Boeing, including as vice president and general manager of Boeing Missile Defense Systems, before moving to the Pentagon as deputy in 2017.

Source: TRTWorld and agencies