In a video posted on YouTube, he said he took on "the tough battles, the hardest fights... because that's what you elected me to do".
Mr Trump has still not fully accepted the result of last November's election, which he lost to Democrat Joe Biden.
Mr Biden will be sworn in as president on Wednesday.
The last two weeks of Mr Trump's term have been dominated by the fallout from the deadly riot on Capitol Hill, when a mob of his supporters stormed Congress, seeking to overturn the election result.
"Political violence is an attack on everything we cherish as Americans. It can never be tolerated," Mr Trump said in his video, in which he did not acknowledge his successor by name.
What else did Trump say?
Mr Trump himself has been impeached for "incitement of insurrection" over the attack and will face trial in the Senate after he leaves office. If convicted, he could be barred from standing for public office.
He is the first president in US history to be impeached twice. At his first trial, he was cleared on charges relating to dealings with Ukraine by the majority from his own Republican Party.
The politically motivated violence has overshadowed the growing toll from the coronavirus pandemic, in which more than 400,000 Americans have died and 24 million have been infected.
In his message, Mr Trump said his administration built "the greatest economy in the history of the world".
US stock markets have rebounded from the coronavirus pandemic, with the tech-heavy Nasdaq index up 42% in 2020, and the wider S&P 500 up 15%.
However, the rest of the economy is facing more of a struggle. Employers cut jobs in December, ending a string of job gains. Retail sales have dropped in recent months, while jobless claims rise.
"Our agenda was not about right or left, it wasn't about Republican or Democrat, but about the good of a nation, and that means the whole nation," Mr Trump said.
He leaves office with an approval rating of 34%, a record low for a departing president.