US defence secretary Jim Mattis has said Donald Trump told him he supports the retired Marine general “100%” following speculation he will be replaced.

The assertion comes just days after the US president mused on American national television about Mr Mattis leaving his post.

Mr Mattis said Mr Trump gave him the assurance during a phone call while he was flying from Washington to Ho Chi Minh City in Vietnam.

Donald and Melania Trump
Mr Trump told 60 Minutes that all appointees move on eventually (AP)

A few hours earlier, Mr Mattis told reporters travelling with him that he and Mr Trump had never discussed the possibility of him leaving the Pentagon job.

Mr Mattis was responding to reporters’ questions about Mr Trump’s comments on CBS’ 60 Minutes on Sunday that Mr Mattis “may leave” his post, and that he thinks the retired US Marine Corps general is “sort of a Democrat”.

Asked what he made of Mr Trump’s comments, in which the president also said he likes Mr Mattis and that eventually all appointees move on, the defence secretary said: “Nothing at all,” adding: “We have never talked about me leaving.”

Later, Mr Mattis approached reporters to say he had called the president aboard Air Force One to discuss damage to military bases caused by Hurricane Michael.

Donald Trump leaves Air Force One
Mr Mattis said he spoke to the president aboard Air Force One (AP)

During that conversation, Mr Trump asked Mr Mattis whether he had seen the 60 Minutes interview broadcast on Sunday. Mr Mattis said he had not. Mr Trump then expressed his full support for Mr Mattis, and suggested Mr Mattis should let the press know this.

By telling 60 Minutes that he suspected Mr Mattis is “sort of a Democrat”, Mr Trump seemed to suggest that he thinks the defence secretary is too moderate in his politics, although he did not say so directly or cite any area of disagreement.

Whereas Mr Trump has made a hardline policy on immigration a centrepiece of his agenda, Mr Mattis has publicly cited the valuable contributions that non-citizen members of the military have made over the years. Mr Mattis is also a staunch supporter of Nato, whereas Mr Trump has questioned its value to America.

Jim Mattis
Mr Mattis said he has not registered with any political party (AP)

Asked directly whether he is a Democrat, Mr Mattis said, “We’re all built on our formative experiences. When I was 18 I joined the Marine Corps, and in the US military we are proudly apolitical.”

Asked if that meant he was not a registered member of either major political party, he replied: “I’ve never registered for any political party.”

Presidents in recent decades have sometimes picked a member of the opposite party to head the Pentagon. Bill Clinton’s second-term defence secretary was William Cohen, a prominent Republican member of the US senate.

President Barack Obama’s first Pentagon chief was Robert Gates, a Republican who had served as CIA director and defence secretary in Republican administrations.