Secretary of Defense Jim Mattis rejected the notion that he was aligned with one political party, pushing back after President Trump questioned his future plans at the Pentagon because he is "sort of a Democrat."

"I've never registered for any political party," Mattis told reporters en route to Vietnam when asked if he had registered as a Republican or a Democrat.

"You know, we're all built on our formative experiences," Mattis said. "When I was 18, I joined the Marine Corps, and in the U.S. military we are proudly apolitical. By that, I mean that in our duties, we were brought up to obey the elected commander in chief, whoever that is. And we've seen, over those -- since I was in the military longer than some of you have been alive, I have seen Republicans and Democrats come and go."

Mattis also said he thought “nothing at all” of Trump’s comments on his future in the administration. Additionally, Mattis said that he has not spoken to Trump about the comments and did not watch the "60 Minutes" interview in which they were made. Mattis also said “we continue in the Department of Defense to do our job” and stressed the comments were “no problem.”

“I'm on his team. We have never talked about me leaving,” Mattis told reporters. “And as you can see right here, we're on our way. We just continue doing our job.”

In an interview with CBS News’ “60 Minutes” that aired Sunday, Trump hinted that Mattis “may” depart the Pentagon because “he’s sort of a Democrat” and “at some point, everybody leaves.”

Additionally, Trump said he knew more than Mattis about the NATO, which was originally created in 1949 and was intended to bolster national security against the Soviet Union and continues to protect its members from possible Russian threats.

"Frankly, I like Gen. Mattis. I think I know more about it than he does," Trump said in the interview. "And I know more about it from the standpoint of fairness, that I can tell you."

[Opinion: Jim Mattis is the military leadership that the US needs. Trump would be wise to keep him]

Last month, there was speculation that Mattis would depart the Pentagon after veteran journalist Bob Woodward reported in his new book that Mattis said Trump behaved and had the understanding of "a fifth- or sixth-grader." The comments were allegedly made after Trump questioned why the U.S. had such a large military presence on the Korean Peninsula.

The book, Fear: Trump in the White House, said Mattis was one of several senior advisers concerned by Trump’s actions on multiple occasions.

Mattis denied making the “contemptuous” comments and called the book “fiction.” Trump also dismissed at the time that Mattis would be replaced.

"Yeah. He'll stay. ... We're very happy with him, we're having a lot of victories, we're having victories that people don't even know about, and he's highly respected all over the world," Trump said in September.

Mattis is traveling to Vietnam where he will meet with his Vietnamese counterpart before heading to Singapore, where he will attend the ASEAN Defense Ministers' Meeting.