He said he was "angry and appalled" by Mr Trump's handling of ongoing protests over the death of African American George Floyd at the hands of police.
Mr Mattis berated Mr Trump's "abuse of authority" - and backed protesters seeking to uphold American values, as did ex-President Barack Obama.
Mr Trump has described Mr Mattis repeatedly as an "overrated general".
Mr Mattis quit in 2018 after Mr Trump decided to pull US troops out of 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!"
The row comes as new charges were brought against all of the sacked police officers present at Mr Floyd's death in the city of Minneapolis.
The charge against Derek Chauvin has been elevated to second-degree murder while the other three officers, previously uncharged, face counts of aiding and abetting murder.
The death has sparked huge protests across the US in recent days.
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.
What did Mattis say?
"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.
"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".
Thank you for reaching out to us. We are happy to receive your opinion and request. If you need advert or sponsored post, We’re excited you’re considering advertising or sponsoring a post on our blog. Your support is what keeps us going. With the current trend, it’s very obvious content marketing is the way to go. Banner advertising and trying to get customers through Google Adwords may get you customers but it has been proven beyond doubt that Content Marketing has more lasting benefits.
We offer majorly two types of advertising:
1. Sponsored Posts: If you are really interested in publishing a sponsored post or a press release, video content, advertorial or any other kind of sponsored post, then you are at the right place.
WHAT KIND OF SPONSORED POSTS DO WE ACCEPT?
Generally, a sponsored post can be any of the following:
Press release
Advertorial
Video content
Article
Interview
This kind of post is usually written to promote you or your business. However, we do prefer posts that naturally flow with the site’s general content. This means we can also promote artists, songs, cosmetic products and things that you love of all products or services.
DURATION & BONUSES
Every sponsored article will remain live on the site as long as this website exists. The duration is indefinite! Again, we will share your post on our social media channels and our email subscribers too will get to read your article. You’re exposing your article to our: Twitter followers, Facebook fans and other social networks.
We will also try as much as possible to optimize your post for search engines as well.
Submission of Materials : Sponsored post should be well written in English language and all materials must be delivered via electronic medium. All sponsored posts must be delivered via electronic version, either on disk or e-mail on Microsoft Word unless otherwise noted.
PRICING
The price largely depends on if you’re writing the content or we’re to do that. But if your are writing the content, it is $60 per article.
2. Banner Advertising: We also offer banner advertising in various sizes and of course, our prices are flexible. you may choose to for the weekly rate or simply buy your desired number of impressions.
Technical Details And Pricing
Banner Size 300 X 250 pixels : Appears on the home page and below all pages on the site.
Banner Size 728 X 90 pixels: Appears on the top right Corner of the homepage and all pages on the site.
Large rectangle Banner Size (336x280) : Appears on the home page and below all pages on the site.
Small square (200x200) : Appears on the right side of the home page and all pages on the site.
Half page (300x600) : Appears on the right side of the home page and all pages on the site.
Portrait (300x1050) : Appears on the right side of the home page and all pages on the site.
Billboard (970x250) : Appears on the home page.
Submission of Materials : Banner ads can be in jpeg, jpg and gif format. All materials must be deliverd via electronic medium. All ads must be delivered via electronic version, either on disk or e-mail in the ordered pixel dimensions unless otherwise noted.
For advertising offers, send an email with your name,company, website, country and advert or sponsored post you want to appear on our website to omodjk(at)gmail(dot)com
Normally, we should respond within 48 hours.