Washington CNN  — 

Former Secretary of Defense James Mattis in an interview released Thursday defended his resignation from the Trump administration last year as well as his decision not to outwardly criticize the sitting president, even in his new book.

“I had no choice but to leave,” he told The Atlantic in the interview. “That’s why (my resignation) letter is in the book. I want people to understand why I couldn’t stay.”

Mattis resigned as President Donald Trump’s first defense secretary in late December after the President announced plans to withdraw US troops from Syria, citing irreconcilable policy differences in a letter to Trump that took many in Washington by surprise. His latest interview follows a string of public statements Mattis has made implicitly criticizing his former commander in chief, with whom he sharply disagreed on matters of international engagement and alliances.

“I’ve been informed by four decades of experience, and I just couldn’t connect the dots anymore,” he added.

In this most recent interview, Mattis declined to directly address the character of Trump – with whom he had an openly rocky relationship marked by presidential Twitter insults – citing a “duty of silence” he owed the administration.

“If you leave an administration, you owe some silence,” Mattis said. “When you leave an administration over clear policy differences, you need to give the people who are still there as much opportunity as possible to defend the country.”

The retired four star general explained his thinking behind the degree of discretion he gave Trump.

“I may not like a commander in chief one fricking bit, but our system puts the commander in chief there, and to further weaken him when we’re up against real threats—I mean, we could be at war on the Korean Peninsula, every time they start launching something,” Mattis said.

When pressed on Trump’s tweet expressing calm over North Korea firing “off some small weapons” – a view at odds with his national security adviser John Bolton and then-host Japanese Prime Minister Shinzo Abe – and belittling former Vice President Joe Biden, Mattis cited his experience as a retired Marine Corps general.

“Any Marine general or any other senior servant of the people of the United States would find that, to use a mild euphemism, counterproductive and beneath the dignity of the presidency,” he said.

He went on, “Let me put it this way. I’ve written an entire book built on the principles of respecting your troops, respecting each other, respecting your allies. Isn’t it pretty obvious how I would feel about something like that?”

But the tight-lipped general did point to an expiration date on his code of silence.

“There is a period in which I owe my silence,” he said. “It’s not eternal. It’s not going to be forever.”

Mattis has recently addressed policy matters as they relate to Trump, namely in his forthcoming book, “Call Sign Chaos: Learning to Lead.” Since taking office, Trump, a frequent NATO skeptic, has been sharply critical of some members of the alliance, and notably broke with members of the G7 over the weekend in pushing for Russia to rejoin the group.

In an essay adapted from the book that was published in The Wall Street Journal on Wednesday, Mattis rejected Trump’s preference for American isolationism, writing in a new essay that the US is “at increasing risk in the world” when it doesn’t embrace its allies.

Although Mattis doesn’t mention Trump by name, it’s clear he’s referring to the commander in chief, making the essay another public rebuke of the President over what Mattis sees as the importance of maintaining US alliances and engagement around the world. Mattis’ views were shared after he left the administration.

“A polemicist’s role is not sufficient for a leader. A leader must display strategic acumen that incorporates respect for those nations that have stood with us when trouble loomed. Returning to a strategic stance that includes the interests of as many nations as we can make common cause with, we can better deal with this imperfect world we occupy together. Absent this, we will occupy an increasingly lonely position, one that puts us at increasing risk in the world,” Mattis wrote.

CNN’s Devan Cole, Jeremy Diamond, Barbara Starr and Zachary Cohen contributed to this report.