WASHINGTON — Jim Mattis, who resigned last year as defense secretary, implicitly criticized the Trump administration in an op-ed published Wednesday by The Wall Street Journal, writing that the current political climate was dividing the country into “hostile tribes” and driving away longtime allies.

The essay is an excerpt from Mr. Mattis’s book, “Call Sign Chaos: Learning to Lead,” which will be published Tuesday by Random House. While most of it is a reflection on leadership and public service, the essay delivers a harsher rebuke to the president’s leadership style than what Mr. Mattis initially penned in his resignation letter in December 2018.

“A polemicist’s role is not sufficient for a leader,” wrote Mr. Mattis, who served more than four decades in the Marine Corps and rose to the rank of four-star general. “A leader must display strategic acumen that incorporates respect for those nations that have stood with us when trouble loomed.”

Mr. Mattis stepped down after pointing to the divide between him and Mr. Trump when it came to respecting and understanding international alliances and because of the president’s decision to announce a hasty withdrawal from Syria.