Former President Barack Obama's personal letter to Donald Trump on Inauguration Day back in January has been published online, showing for the first time the four pieces of advice Obama left for his successor.

CNN obtained and published the copy on Sunday, noting that Obama addressed Trump as simply "Mr. President" at the front.

"Congratulations on a remarkable run. Millions have placed their hopes in you, and all of us, regardless of party, should hope for expanded prosperity and security during your tenure," Obama wrote.

"This is a unique office, without a clear blueprint for success, so I don't know that any advice from me will be particularly helpful. Still, let me offer a few reflections from the past eight years."

The former president then listed his four top pieces of advice for Trump, a number of them focused on the importance of the family.

"First, we've both been blessed, in different ways, with great good fortune. Not everyone is so lucky. It's up to us to do everything we can [to] build more ladders of success for every child and family that's willing to work hard," Obama began.

"Second, American leadership in this world really is indispensable. It's up to us, through action and example, to sustain the international order that's expanded steadily since the end of the Cold War, and upon which our own wealth and safety depend," he added.

"Third, we are just temporary occupants of this office. That makes us guardians of those democratic institutions and traditions — like rule of law, separation of powers, equal protection and civil liberties — that our forebears fought and bled for," Obama continued.

"Regardless of the push and pull of daily politics, it's up to us to leave those instruments of our democracy at least as strong as we found them."

Lastly, he urged Trump to "take time, in the rush of events and responsibilities, for friends and family. They'll get you through the inevitable rough patches."

Obama said that he and former first lady Michelle wish Trump "the very best" on "this great adventure," and promised to help if called upon.

Obama and Trump have had a rocky relationship in the wake of the billionaire businessman's election victory last year.

While the two presidents participated in cordial meetings during the transition of power, they have since clashed on some topics. Trump accused Obama in March of having tapped his phones at Trump Tower during the late stages of the 2016 election campaign.

"Terrible! Just found out that Obama had my 'wires tapped' in Trump Tower just before the victory. Nothing found. This is McCarthyism!" Trump wrote in a tweet back then.

"Is it legal for a sitting President to be 'wire tapping' a race for president prior to an election? Turned down by court earlier. A NEW LOW!" he added in another post.

Kevin Lewis, a spokesman for the former president, firmly denied the allegations in a statement.

"Neither President Obama nor any White House official ever ordered surveillance on any U.S. citizen. Any suggestion otherwise is simply false," Lewis said.

Letters of previous presidents offering their advice to their successors have also gone public in recent years, such as George W. Bush's thoughts for Obama back in January 2009.

"There will be trying moments. The critics will rage. Your 'friends' will disappoint you. But, you will have an Almighty God to comfort you, a family who loves you, and a country that is pulling for you, including me," Bush wrote at the time.

"No matter what comes, you will be inspired by the character and compassion of the people you now lead."