Former Defense Secretary Jim Mattis warned that “tribalism” must not be allowed to undermine American democracy and “we all know that we’re better than our current politics” in an essay published in the Wall Street Journal on Wednesday.

Mattis’ thoughts, adapted from his upcoming book on his time in the Marine Corps and President Donald Trump’s administration, also echoed some of the messages in his resignation letter from last year, where he appeared to criticize Trump for his hostility toward traditional U.S. allies.

“Nations with allies thrive, and those without them wither,” he wrote. “Alone, America cannot protect our people and our economy.

“At this time, we can see storm clouds gathering. 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.”

He also warned of increasing tensions worldwide, and said America alone cannot eliminate all of those threats.

“An oft-spoken admonition in the Marines is this: When you’re going to a gunfight, bring all your friends with guns,” he wrote. “Having fought many times in coalitions, I believe that we need every ally we can bring to the fight.”

Mattis wrote that he was surprised by Trump’s offer to make him defense secretary but felt prepared and duty-bound to take on the task.

“When it comes to the defense of our experiment in democracy and our way of life, ideology should have nothing to do with it,” he said in the piece. “Whether asked to serve by a Democratic or a Republican, you serve. ‘Politics ends at the water’s edge’: That ethos has shaped and defined me, and I wasn’t going to betray it.”

Mattis was one of Trump’s best-known and most-praised Cabinet officials before the relationship between the two soured in 2018, after a series of military policy moves that seemed to catch Pentagon leadership by surprise.

On his resignation — a move that left the Defense Department without a permanent leader for more than 200 days, the longest in American history — Mattis said that he served in the secretary post “as well as I could for as long as I could” before he felt it was time to leave.

“When my concrete solutions and strategic advice, especially keeping faith with our allies, no longer resonated, it was time to resign, despite the limitless joy I felt serving alongside our troops in defense of our Constitution,” he wrote.

“Unlike in the past, where we were unified and drew in allies, currently our own commons seems to be breaking apart. What concerns me most as a military man is not our external adversaries; it is our internal divisiveness. We are dividing into hostile tribes cheering against each other, fueled by emotion and a mutual disdain that jeopardizes our future, instead of rediscovering our common ground and finding solutions.”

Since Mattis’ departure from the administration, Trump has on several occasions belittled the former Marine Corps general, insisting that he fired Mattis because he was “not too good” at the job.

Mattis’ book, titled “Call Sign Chaos: Learning to Lead,” is scheduled to be released next week.