Washington CNN  — 

Former Defense Secretary James Mattis, who resigned last year citing irreconcilable policy differences with President Donald Trump, on Wednesday 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.

In an essay that was adapted from his forthcoming book, “Call Sign Chaos: Learning to Lead,” a portion of which was published in The Wall Street Journal, the retired Marine Corps general also said he stepped down in December when he thought his advice was no longer valid in Trump’s eyes, writing, “I did as well as I could for as long as I could.”

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.

In late December, after Trump announced plans to withdraw US troops from Syria, Mattis resigned as the President’s first defense secretary. 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 the excerpt published Wednesday, Mattis wrote that his resignation last year came after his “concrete solutions and strategic advice, especially keeping faith with our allies, no longer resonated.” In his letter last year, Mattis wrote that he was stepping down because Trump has “the right to have a Secretary of Defense whose views are better aligned” with his own.

In the essay, Mattis was clear in his defense of international coalitions, writing: “Having fought many times in coalitions, I believe that we need every ally we can bring to the fight. From imaginative military solutions to their country’s vote in the U.N., the more allies the better. I have never been on a crowded battlefield, and there is always room for those who want to be there alongside us.”

Mattis also expressed concern in his essay for the current political and social climates of the US, writing, “All Americans need to recognize that our democracy is an experiment—and one that can be reversed. We all know that we’re better than our current politics. Tribalism must not be allowed to destroy our experiment.”

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