The assertion comes just days after Trump mused on national television about Mattis leaving his post.
Mattis said Trump gave him this assurance during a phone call while Mattis was flying from Washington to Ho Chi Minh City, Vietnam, on Tuesday. A few hours earlier, Mattis told reporters traveling with him that he and Trump had never discussed the possibility of Mattis leaving the Pentagon job.
Mattis initially was responding to reporters' questions about Trump's comments on CBS' "60 Minutes" Sunday that Mattis "may leave" his administration and that he thinks the retired Marine Corps general is "sort of a Democrat."
Asked what he made of Trump's comments, in which the president also said he likes Mattis and that eventually all appointees move on, Mattis said, "Nothing at all," adding, "We have never talked about me leaving."
Later, Mattis approached reporters traveling with him to say he'd just spoken to Trump. He said he called the president aboard Air Force One to discuss damage to military bases caused by Hurricane Michael.
During that conversation, Trump asked Mattis whether he had seen the “60 Minutes” interview broadcast on Sunday. Mattis said he had not. Trump then expressed his full support for Mattis and suggested Mattis let the press know this.
By telling "60 Minutes" that he suspected Mattis is "sort of a Democrat," Trump seemed to suggest that he thinks Mattis is too moderate in his politics, although he did not say so directly or cite any area of disagreement with Mattis.
Whereas Trump has made a hard-line policy on immigration a centerpiece of his agenda, Mattis has publicly cited the valuable contributions that non-citizen members of the military have made over the years. Mattis also is a staunch supporter of NATO, whereas Trump has questioned its value to America.
Mattis, who had never previously held a civilian position in government before he became defense secretary in January 2017, told reporters he has sought to carry out and reinforce Trump's military and national security policies without regard to partisanship. Those policies, he said, are now "reaping significant bipartisan support."
Asked directly whether he is a Democrat, Mattis said, "We're all built on our formative experiences. When I was 18 I joined the Marine Corps, and in the U.S. 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. President Bill Clinton's second-term defense secretary was William Cohen, a prominent Republican member of the Senate. And President Barack Obama's first Pentagon chief was Robert Gates, a Republican who had served as CIA director and defense secretary in Republican administrations.
The post of defense secretary is typically the least political in a president's Cabinet. That is because of the non-political tradition of the military and long-standing bipartisan support for U.S. military alliances such as NATO.
Mattis flew to Vietnam for his second visit this year to the country with which the U.S. fought a 10-year war. He told reporters the violent history between the two countries is a thing of the past.
"The legacy of the war has turned into actually a basis for defense cooperation," he said.
An example of this is a U.S.-funded $390 million project to clean up war-era chemical contamination of the ground at an air base near Ho Chi Minh City.
Mattis planned to visit the base at Bien Hoa on Wednesday to see firsthand the area that is to be decontaminated in a 10-year project funded by the U.S. Agency for International Development. Barrels of Agent Orange had been staged at Bien Hoa for U.S. use as a defoliant elsewhere in Vietnam, and when the U.S. decided to stop spraying Agent Orange, the remaining barrels of toxic liquid were collected and stored at Bien Hoa before being flown out of the country.
Mattis also plans to attend a regional meeting of defense ministers in Singapore later this week. He said he may meet there with his Chinese counterpart, even though Beijing had recently told Mattis that if he came to China his counterpart would not be available to meet.