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.

Read More