The announcement came just a day after the stunning report that the president was planning to pull USA troops out of Syria, and another report Thursday that he was considering doing the same in Afghanistan.
Speculation that he may not last long in his post grew in October when President Trump said in a CBS interview that the general was "sort of a Democrat" and might be leaving.
In a letter announcing his retirement, Mattis said it was his core belief that the United States needs to maintain strong alliances and show respect for allies.
Here are the major takeaways from Mattis' letter, and what they say about the differences between the president and his secretary of defense.
Tillerson was sacked early this year.
"This is scary", Democratic Senator Mark Warner said.
"Secretary Mattis is firmly in the camp of the job in Syria is not yet done".
The retired Marine general, 68, had repeatedly moved to reassure allies unnerved by Trump's unpredictable pronouncements and argued successfully for continued US commitments in Syria, Afghanistan and other places where military leaders see an ongoing threat.
A senior administration official told CNN's Jake Tapper that Mattis was "vehemently opposed" to the Syria decision, but Mattis' letter appears to point to various foreign policy views. Mattis' exit and Trump's border wall shutdown threat fit snugly with this theory of Crazytown. Trump said a replacement would be chosen soon. The Trump administration has had the highest senior-level staff turnover of the past five presidents, according to the Brookings Institution.
The two quickly clashed on major policy decisions. Its two major points: 1) The U.S. must value and respect our allies; and 2) stand up to Russian Federation and China-two issues in which Trump is the weakest U.S. President in the modern era.
Mattis submitted a letter of recognition citing that Trump has the right to have a Secretary of Defense that shares his views and then listed various issues that Trump and him don't align on. Furthermore, there are now reports that the president is actively considering withdrawing as many as 3,000 of the 14,000 troops in Afghanistan.