James Mattis was President Donald Trump's first defense secretary- but resigned in 2018- Reuters
Former US Defence Secretary James Mattis has denounced President Donald Trump, accusing him of stoking division and abusing his authority.
In rare public comments, Mr Mattis said the president had sought to "divide" the American people and had failed to provide "mature leadership".
He said he was "angry and appalled" by Mr Trump's handling of recent unrest.
In response, the president described Mr Mattis as an "overrated general" and said he was glad he had left the post.
Mr Mattis resigned in 2018 after Mr Trump decided to withdraw US troops from Syria.
He has remained mostly silent since then, until his rebuke of the Trump administration was published in The Atlantic magazine on Wednesday.
In response to the fresh criticism, Mr Trump posted a series of tweets in which he claimed to have fired Mr Mattis.
"I didn't like his "leadership" style or much else about him, and many others agree," he wrote. "Glad he is gone!"
"Donald Trump is the first president in my lifetime who does not try to unite the American people - does not even pretend to try," Mr Mattis wrote in The Atlantic. "Instead, he tries to divide us."
He continued: "We are witnessing the consequences of three years of this deliberate effort. We are witnessing the consequences of three years without mature leadership."
Mr Mattis also addressed the recent wave of anti-racism protests that were triggered by the death of African-American George Floyd in police custody earlier this month.
Four officers have been charged in relation to Mr Floyd's death in Minneapolis on 25 May. The charge against Derek Chauvin was elevated to second-degree murder on Wednesday.
The vast majority of demonstrations over the past nine days have been peaceful, but some have turned violent and curfews have been imposed in a number of cities.
"We must not be distracted by a small number of lawbreakers," Mr Mattis wrote. "The protests are defined by tens of thousands of people of conscience who are insisting that we live up to our values... as a nation."
The retired general - whose resignation letter in December 2018 was full of implied criticism of the president's foreign policy - also condemned the use of the military in response to the protests.
"Never did I dream that troops... would be ordered under any circumstance to violate the Constitutional rights of their fellow citizens," he said.
"Militarising our response, as we witnessed in Washington DC, sets up a conflict... between the military and civilian society," he added.
Mr Mattis was referring to an incident earlier this week when peaceful protesters were dispersed with tear gas and rubber bullets from a park close to the White House.
Mr Trump then crossed the park for a photo-op at a historic church that had been damaged by fire in the unrest.
This provoked sharp criticism from top Democrats and religious leaders, who accused the president of aggressively targeting the demonstrators for the purpose of posing for photographs.
In his latest comments, Mr Mattis derided the "bizarre photo-op" and said clearing the park of demonstrators beforehand was an "abuse of executive authority".
Mr Trump has repeatedly questioned whether the protesters were peaceful and, in an earlier tweet, he said "people liked my walk to this historic place of worship".
And in an interview with his former press secretary Sean Spicer on Wednesday, the president once again defended the church visit. He said it was "handled really well" and "religious leaders loved it".
Protests over the death of George Floyd continued in dozens of cities on Wednesday night despite widespread curfews.
They have been largely peaceful, with cities such as Los Angeles and Chicago relaxing their restrictions amid hopes that the worst of the violence had passed.
A post-mortem examination has revealed that Floyd had the coronavirus in early April. But officials stressed that this played no role in his death.