Speaking to reporters as he flew from Washington to Ho Chi Minh City at the start of a diplomatic tour that will take him to Vietnam and Singapore, Mattis said he had spoken directly to Trump by phone late Monday morning Washington time.
"He said, I m 100 percent with you ," Mattis said.
His remark comes after US broadcaster CBS on Sunday aired an interview with Trump, in which he suggested Mattis may be headed out the Pentagon door.
"It could be that he is. I think he s sort of a Democrat, if you want to know the truth," Trump said.
"But General Mattis is a good guy. We get along very well. He may leave. I mean, at some point, everybody leaves."
Earlier on in the 20-hour flight to Vietnam -- before he d spoken to Trump, who himself was flying on Air Force One to Florida -- Mattis was asked what he d made of Trump s comments.
"Nothing at all," Mattis said.
"I m on his team. We have never talked about me leaving. And as you can see right here, we are on our way, we just continue doing our job... no problem."
He added that he had never registered with any political party, and that those in the military are "proudly apolitical".
It reached fever pitch in September, when veteran journalist Bob Woodward published a book giving an inside glimpse into a chaotic White House and said Mattis had questioned Trump s judgment, likening his understanding to that of a 10- or 11-year-old child.
Mattis s fate has been the subject of intense speculation for months amid rumours of his turbulent relationship with President Donald Trump Mattis, a buttoned-up former Marine Corps general, is loath to discuss politics or his relationship with Trump, and the president is widely reported to bristle at unfavourable comparisons to Mattis, who has broad bipartisan support.
The Woodward book details a number of times Mattis or Trump officials are said to have slow-walked orders from the president, such as in the aftermath of Trump s tweets last year that said all transgender personnel would be banned from the military.
Trump is looking to reshape his cabinet after the mid-term elections, which will determine whether the Democrats can regain some degree of power after a total and humiliating defeat in 2016.
The president has already cast off many of his original top-level picks, including former secretary of state Rex Tillerson and Lieutenant General HR McMaster, who had been national security advisor.
Last week, his ambassador to the United Nations, Nikki Haley, announced her resignation, effective at the end of the year.
Speculation of Mattis s future in the Trump administration loomed over his arrival Tuesday in Ho Chi Minh City for a week-long trip likely to be dominated by escalating tensions between Washington and Beijing over a roster of issues.
En route to Vietnam, Mattis blasted China s increasingly muscular military presence in the South China Sea and "predatory economic practices" towards smaller countries in Asia.
But after weeks of worsening military-to-military strains with China as a trade war with the US slogs on, Mattis said Washington was not trying to hold back its Pacific rival.
"Obviously, we re not out to contain China," he told reporters. "We d have taken an altogether different stance had that been considered."
The defence chief s Asia trip initially included a leg in Beijing, but that fell through after China declined to make Mattis s counterpart available for him to meet.
Mattis s trip to Vietnam is his second to the country after his visit to Hanoi in January.
Such visits by US defense secretaries have until now been exceedingly rare, and Mattis s presence strongly signals the importance Washington sees in further enhancing ties with a former foe amid rising tensions with China. - APP / AFP