U.S. Secretary of Defense Jim Mattis walks to greet incoming National Security Advisor John Bolton upon Bolton
U.S. Secretary of Defense Jim Mattis walks to greet incoming National Security Advisor John Bolton upon Bolton's arrival for a meeting at the Pentagon, on March 29, 2018 in Arlington, Virginia. (Mark Wilson/Getty Images)
PHOTO: Mark Wilson/Getty Images
Now playing
01:49
Mattis writes on experience working for Trump in essay
Now playing
02:38
Biden: Science team 'among the brightest, most dedicated'
The Atlantic Ocean is seen adjacent to President Donald Trump
The Atlantic Ocean is seen adjacent to President Donald Trump's beach front Mar-a-Lago resort, also sometimes called his Winter White House, the day after Florida received an exemption from the Trump Administration's newly announced ocean drilling plan on January 11, 2018 in Palm Beach, Florida.
PHOTO: Joe Raedle/Getty Images
Now playing
03:19
Donald Trump's plan to move to Mar-a-Lago faces challenges
Trump talks to reporters while hosting Republican Congressional leaders and members of his cabinet in the Oval Office at the White House July 20, 2020 in Washington, DC.
Trump talks to reporters while hosting Republican Congressional leaders and members of his cabinet in the Oval Office at the White House July 20, 2020 in Washington, DC.
PHOTO: Doug Mills/Pool/Getty Images
Now playing
01:19
Historian on Trump's legacy: He's an 'asterisk president'
Mike Pence remarks vpx
Mike Pence remarks vpx
PHOTO: Senate TV
Now playing
02:27
New timeline shows just how close rioters got to Pence and his family
PHOTO: CNN
Now playing
01:48
FBI warns of potential armed protests across country
MyPillow notes
MyPillow notes
PHOTO: Jabin Botsford
Now playing
02:21
Photographer snaps notes of MyPillow CEO after visiting Trump
PHOTO: CNN
Now playing
04:31
Congressman concerned about being harmed by fellow lawmakers
Metropolitan Police Officer Michael Fanone
Metropolitan Police Officer Michael Fanone
PHOTO: CNN
Now playing
04:56
DC officers speak out following Capitol riot
Senator-elect Tommy Tuberville, a Republican from Alabama, stands for a photo at the US Capitol in Washington, DC, on November 9, 2020. (Photo by Stefani Reynolds / POOL / AFP) (Photo by STEFANI REYNOLDS/POOL/AFP via Getty Images)
Senator-elect Tommy Tuberville, a Republican from Alabama, stands for a photo at the US Capitol in Washington, DC, on November 9, 2020. (Photo by Stefani Reynolds / POOL / AFP) (Photo by STEFANI REYNOLDS/POOL/AFP via Getty Images)
PHOTO: STEFANI REYNOLDS/AFP via Getty Images
Now playing
03:20
Senator-elect Tommy Tuberville flubs 3 branches of government
MOON TOWNSHIP, PA - SEPTEMBER 22: Ivanka Trump and Jared Kushner listen as President Donald Trump speaks at a campaign rally at Atlantic Aviation on September 22, 2020 in Moon Township, Pennsylvania. Trump won Pennsylvania by less than a percentage point in 2016 and is currently in a tight race with Democratic nominee, former Vice President Joe Biden. (Photo by Jeff Swensen/Getty Images)
MOON TOWNSHIP, PA - SEPTEMBER 22: Ivanka Trump and Jared Kushner listen as President Donald Trump speaks at a campaign rally at Atlantic Aviation on September 22, 2020 in Moon Township, Pennsylvania. Trump won Pennsylvania by less than a percentage point in 2016 and is currently in a tight race with Democratic nominee, former Vice President Joe Biden. (Photo by Jeff Swensen/Getty Images)
PHOTO: Jeff Swensen/Getty Images
Now playing
01:55
Where do Ivanka Trump and Jared Kushner go from here?
FBI Director Christopher Wray speaks during a virtual news conference at the Department of Justice on October 28, 2020 in Washington, DC.
FBI Director Christopher Wray speaks during a virtual news conference at the Department of Justice on October 28, 2020 in Washington, DC.
PHOTO: Sarah Silbiger/Getty Images
Now playing
03:47
FBI director speaks publicly for first time since Capitol riots
PHOTO: POOL
Now playing
00:48
Pence makes surprise visit to Capitol to thank National Guard
Now playing
00:00
Biden: Real pain overwhelming the real economy
Staffer White House move out
Staffer White House move out
PHOTO: CNN
Now playing
01:36
Moving trucks spotted at White House as staffers clean out their desks
(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.