(CNN) During his final moments in the Oval Office, President Barack Obama folded into thirds a handwritten letter to Donald Trump, slid it into an envelope, and in neat capital letters addressed it to "Mr. President."

Now, the contents of that letter -- the last direct communication between the 44th and 45th presidents -- have emerged for the first time after CNN obtained a copy.

Full letter

Dear Mr. President -

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.

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 8 years.

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.

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.

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. 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.

And finally, take time, in the rush of events and responsibilities, for friends and family. They'll get you through the inevitable rough patches.

Michelle and I wish you and Melania the very best as you embark on this great adventure, and know that we stand ready to help in any ways which we can.

Good luck and Godspeed,

BO

Four pieces of advice

The words reveal a conciliatory outgoing commander in chief with four items of advice for his successor, whose fitness for the job he'd spent the previous months openly questioning.

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

Written out longhand on White House stationery and slipped into the top drawer of the Resolute Desk, the 275-word letter captures an outgoing president eager to instill in Trump the vast responsibilities and uncertain parameters of the job.

Obama, when writing the letter, didn't disclose the content even to his closest aides. Since then, however, Trump has shown the letter to visitors in the Oval Office or his private White House residence. CNN obtained a copy from someone Trump showed it to.

"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," Obama wrote. "Still, let me offer a few reflections from the past 8 years."

Obama reminds Trump, a billionaire businessman, that they've both been "blessed, in different ways, with great good fortune."

"Not everyone is so lucky," Obama said. "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."

He advises Trump that American leadership is "indispensable" and encourages him "through action and example" to sustain post-Cold War international order.

And he offers a warning against eroding the tenets of democracy in the name of political gain.

"We are just temporary occupants of this office," Obama wrote. "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."

"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," he said.

That passage, read seven months after Trump took office, appears prescient. Trump has been accused of flouting rule of law in his broadsides against federal judges and his own attorney general. His verbal assaults on Congress have led to charges that he's disregarding the constitutionally enshrined separate but equal branches of government.

Trump, however, is said to cherish Obama's missive. Upon reading it on Inauguration Day, he attempted to place a phone call to the former president expressing his gratitude, according to both a current White House official and a former Obama aide. His predecessor was traveling west to California with his family, and couldn't take the call.

When one of Obama's aides reached back out to the White House to return the call, the new president's staffers said Trump just wanted to say thank you for the note -- and wanted Obama to get the message. The men never connected directly.

"It was long. It was complex. It was thoughtful," Trump said of the letter the week after taking office in an interview with ABC News. "And it took time to do it, and I appreciated it."

During the interview, Trump showed the news crew the letter, pulling it from its envelope. He wouldn't read it out loud.

In writing Trump the letter, Obama was continuing a long tradition set by past presidents. He received his own handwritten note from George W. Bush on the day of his inauguration counseling him of uncertain days ahead.

"There will be trying moments. The critics will rage. Your 'friends' will disappoint you," Bush wrote. "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."

Eight years earlier, Bill Clinton offered an optimistic view of the job.

"The burdens you now shoulder are great but often exaggerated," he wrote Bush in 2000 . "The sheer joy of doing what you believe is right is inexpressible."

And in 1992, George H.W. Bush wrote Clinton that "your success now is our country's success."

"I am rooting hard for you," he concluded. "Good luck."

Obama's letter is nearly twice as long as his predecessors' and includes more specific pieces of advice. But like Clinton and both Bushes, he offers a view of the job that accounts both for its thrill but also its ability to humble.

"Take time, in the rush of events and responsibilities, for friends and family," Obama wrote. "They'll get you through the inevitable rough patches."

Since reading the letter for the first time, Trump hasn't spoken or seen Obama. Instead he's frequently criticized the former president, rolled back significant elements of Obama's agenda, and privately obsessed about comparisons between himself and the man he replaced.

Obama, meanwhile, has weighed in selectively on Trump since leaving office. He criticized decisions to withdraw from the Paris climate accord and repeal Obamacare, but did not directly address Trump's equivocal comments about white supremacists in Virginia, even as others reacted with withering criticism.

Before all that, however, Obama wrote that he was willing to remain in touch.

"Michelle and I wish you and Melania the very best as you embark on this great adventure, and know that we stand ready to help in any ways which we can," he wrote in his sign-off.

"Good luck and Godspeed."