Defense Secretary and retired Marine Gen. James Mattis, whose retirement from the Pentagon was announced Thursday by President Trump, is an archetypal American warrior. This country loves military leaders like him who speak their minds without any concern for how it will make the sensitive types feel.

In more than four decades as a Marine, Mattis’ job was defending our nation and killing our enemies. He was brilliant and extraordinarily effective doing that. One of his more memorable quotes showcases his attitude and persona perfectly: “Be polite, be professional, but have a plan to kill everybody you meet.”

Mattis fought bravely in the Persian Gulf War, in Afghanistan and in the Iraq War. Plenty of bad people got what they deserved when he put his plans into action.

When Mattis was tapped to be secretary of defense by President Trump he received nearly universal acclaim – one of the few Trump appointments that both Democrats and Republicans said was a wise one.

Mattis and President Trump started out sharing a strong position against North Korea, which was conducting regular missile and nuclear weapons tests and presented a growing danger. They both fired some powerful rhetoric at the regime of North Korean dictator Kim Jong Un. And they gave the impression that the secretary of defense was ready to put some teeth into those threats if need be.

But that was about the last of the smooth sailing for the Trump-Mattis partnership. It didn’t take long to see that the two men were not well-aligned on either style of substance.

It also seemed like Mattis never really felt comfortable in a suit and tie as opposed to combat boots and a helmet. In the early days of Trump’s Cabinet, Mattis and Secretary of State Rex Tillerson soon emerged as a sort of counterweight to the president’s more assertive ambitions.

The Iran nuclear deal soon became a particular sticking point. President Trump had promised to dismantle what he correctly called one of the worst deals America had ever made. Mattis and Tillerson worked diligently and in concert to change the president’s mind and even to slow down the process of withdrawing from the nuclear agreement.

This eventually angered Trump and in a famous blow-up he reportedly told both Mattis and Tillerson to bring him the plans for pulling out of the Iran deal he had asked for – or heads would roll.

The president eventually got his way – he is the commander-in-chief, after all. But his relationship with Mattis continued to sour amid disagreements over the policy on transgender troops and Mattis’ concern over Trump’s regular attacks on some of our longstanding allies.

But we don’t elect presidents to have their subordinates stop them from implementing their policies. It is one thing to have a “team of rivals.” It is unacceptable for the president to be prevented from leading the nation by Cabinet members not on board with his agenda.

The president expected our allies to act like allies and spend more on their own defense, rather than riding along in safety on the back of our military spending. NATO members got the message from the president that they had to pull their own weight – and Mattis was required to reluctantly reinforce that message.

The disagreements between the president and his defense secretary continued and the men rarely met in person. Trump even said earlier this year that Mattis might be going and speculated: “I think he’s sort of a Democrat, if you want to know the truth.”

The last straw for Mattis appeared to be the president’s decision to pull U.S. forces out of Syria, which Trump had long been promising to do – although most of his national security team opposed the decision.

Mattis made one final plea to President Trump change his mind on the Syria withdrawal and was rebuked.

Mattis then penned a fairly pointed resignation letter the following day. He complained that he believed in respecting our allies and implied that Trump did not.

The defense secretary wrote: “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.”

The most telling line in the resignation letter was: “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.”

In the end this is the truth. Many people who don’t like or support President Trump, and even some who do, thought having Mattis as the brake on Trump’s action-oriented nature was a good thing.

But we don’t elect presidents to have their subordinates stop them from implementing their policies. It is one thing to have a “team of rivals.” It is unacceptable for the president to be prevented from leading the nation by Cabinet members not on board with his agenda.

Mattis will be more favorably remembered for his time as a Marine Corps officer who combined a hard-charging attitude with the scholarly nature that led many to call him a warrior monk. His time as secretary of defense was honorable but not noteworthy in the way his time with the Marines was, when he lived up to his radio call sign of “Chaos Actual.”

Despite his difficulties with the president he served as defense secretary, Mattis deserves great thanks and respect for the tremendous service he gave to this country for more than four decades as a Marine and later in the Cabinet.