US President Donald Trump has forced Defence Secretary James Mattis to leave his post early, appointing an acting successor to take over in the new year.

Gen Mattis, 68, strongly hinted at policy differences with Mr Trump when he resigned on Friday.

He offered to stay in the job until February but will now leave on 1 January after Mr Trump reportedly balked at media coverage of his exit.

Deputy Defence Secretary Patrick Shanahan, 56, will take over the role.

Mr Trump has lauded his achievements and described him as "very talented".

Mr Shanahan, a former executive at the aerospace giant Boeing, joined the Pentagon in July 2017 after Mr Trump nominated him.

He was reportedly a vocal supporter of the president's plan to establish a sixth branch of the armed forces, known as the "space force".

Originally from Washington state, Mr Shanahan studied mechanical engineering and business at the Massachusetts Institute of Technology and joined Boeing as an engineer in 1986.

Donald Trump had initially framed James Mattis's departure as a "retirement" but his resignation letter - full of implied criticism of the president's foreign policy - showed that was not the case.

The president seldom handles rebukes kindly, so it became increasingly unlikely the former general would be allowed his requested two-month departure timeframe.

On Sunday morning, the hammer came down - as is the new norm - via a presidential tweet.

Gen Mattis resigned shortly after President Trump announced his decision to withdraw all US troops from Syria.

While not mentioning it in his resignation letter directly, the general previously warned that it would be a "strategic blunder".

In his letter, he also said the president had the right to appoint someone "whose views are better aligned with yours".

But shortly after announcing Mr Shanahan's appointment on Sunday, Mr Trump moved to calm widespread concerns over the pullout which he initially said would be "rapid".

Mr Trump said on Twitter that he had spoken with President Recep Tayyip Erdogan of Turkey about "our mutual involvement in Syria, & the slow and highly coordinated withdrawal of US troops from the area".

Mr Erdogan's office said the two leaders had agreed to "ensure coordination between their countries' military, diplomatic and other officials to avoid a power vacuum which could result following any abuse of the withdrawal and transition phase in Syria".

Kurdish forces in Syria, which Turkey regards as a threat, have been successfully fighting the Islamic State group with US support.

They now fear Turkey will use America's withdrawal to launch a new campaign against them.