In his surprise announcement early Thursday evening that Secretary of Defense James Mattis would leave the administration at the end of February, President Trump made sure to heap praise on the former Marine general. But in his resignation letter, Mattis indicates that his decision to leave was driven by deep personal disagreements with the president.

Here are the major takeaways from Mattis' letter, and what they say about the differences between the president and his secretary of defense.

Respect for allies

Early on in the letter, Mattis indicated that he believes Mr. Trump has not treated U.S. allies with the appropriate respect. While saying he agrees with the president that the U.S. should not be the "policeman of the world," he also said that healthy relationships with allies are essential to peace and prosperity. "[W]e must use all tools of American power to provide for the common defense, including providing effective leadership to our alliances," Mattis wrote. "NATO's 29 democracies demonstrated that strength in the commitment to fighting alongside us following the 9-11 attack on America. The Defeat-ISIS coalition of 74 nations is further proof."

Get Breaking News Delivered to Your Inbox

Highlighting the anti-ISIS coalition and NATO is significant because Mr. Trump has had serious issues with both. The president has repeatedly questioned NATO's relevance in the post-Cold War era, and called for European nations to increase their defense budgets. He also left the allies in the fight against ISIS flat-footed earlier this week with his surprise decision to withdraw U.S. forces from Syria.

An "unambiguous" response to rivals

The Trump administration has taken a hard line against Russia and China in various ways, including the numerous sanctions its imposed on Moscow and the trade war its undertaken with Beijing. At the same time, Mr. Trump has repeatedly lavished praise on the authoritarian leaders of both countries, Vladimir Putin and Xi Jinping, and suggested that the U.S. engages in similar behavior.

This approach to Russia and China does not appear to sit well with Mattis.

"Similarly, I believe we must be resolute and unambiguous in our approach to those countries whose strategic interests are increasingly in tension with ours," he wrote. "It is clear that China and Russia, for example, want to shape a world consistent with their authoritarian model -- gaining veto authority over other nations' economic, diplomatic, and security decisions -- to promote their own interests at the expense of their neighbors, America and our allies. That is why we must use all the tools of American power to provide for the common defense."

The letter continues: "My views on treating allies with respect and also being clear-eyed about both malign actors and strategic competitors are strongly held and informed by over four decades of immersion in these issues. We must do everything possible to advance an international order that is most conducive to our security, prosperity and values, and we are strengthened in this effort by the solidarity of our alliances."

These differences drove Mattis out

It is not unusual for an official to resign for vague reasons, or a desire to spend time with family. Mattis, however, takes a different approach, saying outright that he is leaving because he disagrees with the president.

"Because you have the right to have a Secretary of Defense whose views are better aligned with yours on these and other subjects, I believe it is right for me to step down from my position," Mattis writes. He says he will leave at the end of February in order for a successor to be confirmed by the Senate, and also "make sure the Department's interests are properly articulated and protected" during meetings with Congress and NATO allies.

Mattis also notably abstains from complimenting Mr. Trump, who tends to expect deference from his subordinates. The closest he gets is in the last line of his letter, when he simply thanks the president for the opportunity "to serve the nation and our men and women in uniform."

Read James Mattis' entire resignation letter

Dec. 20, 2018

Dear Mr. President:

I have been privileged to serve as our country's 26th Secretary of Defense which has allowed me to serve alongside our men and women of the Department in defense of our citizens and our ideals.

I am proud of the progress that has been made over the past two years on some of the key goals articulated in our National Defense Strategy: putting the Department on a more sound budgetary footing, improving readiness and lethality in our forces, and reforming the Department's business practices for greater performance. Our troops continue to provide the capabilities needed to prevail in conflict and sustain strong U.S. global influence.

One core believe I have always held is that our strength as a nation is inextricably linked to the strength of our unique and comprehensive system of alliances and partnerships. While the U.S. remains the indispensable nation in the free world, we cannot protect our interests or serve that role effectively without maintaining strong alliances and showing respect to those allies. Like you, I have said from the beginning that the armed forces of the United States provide for the common defense, including providing effective leadership to our alliances. NATO's 29 democracies demonstrated that strength in their commitment to fighting alongside us following the 9-11 attack on America. The Defeat-ISIS coalition of 74 nations is further proof.

Similarly, I believe we must be resolute and unambiguous in our approach to those countries whose strategic interests are increasingly in tension with ours. It is clear that China and Russia, for example, want to shape a world consistent with their authoritarian model -- gaining veto authority over other nations' economic, diplomatic, and security decisions -- to promote their own interests at the expense of their neighbors, America and our allies. That is why we must use all the tools of American power to provide for the common defense.

My views on treating allies with respect and also being clear-eyed about both malign actors and strategic competitors are strongly held and informed by over four decades of immersion in these issues. We must do everything possible to advance an international order that is most conducive to our security, prosperity and values, and we are strengthened in this effort by the solidarity of our alliances.

Because you have the right to have a Secretary of Defense whose views are better aligned with yours on these and other subjects, I believe it is right for me to step down from my position. The end date for my tenure is February 28, 2019, a date that should allow sufficient time for a successor to be nominated and confirmed as well as to make sure the Department's interests are properly articulated and protected at upcoming events to include Congressional posture hearings and the NATO Defense Ministerial meeting in February. Further, that a full transition to a new Secretary of Defense occurs well in advance of the transition of Chairman of the Joint Chiefs of Staff in September in order to ensure stability within the Department.

I pledge my full effort to a smooth transition that ensures the needs and interests of the 2.15 million Service Members and 732,079 DoD civilians receive undistracted attention of the Department at all times so that they can fulfill their critical, round-the-clock mission to protect the American people.

I very much appreciate this opportunity to serve the antion and our men and women in uniform.

James N. Mattis