WASHINGTON—Before he left office in January, U.S. president Barack Obama offered his successor accolades and advice in a private letter that underscored some of his concerns as he passed the baton.

In the letter, published Sunday by CNN, Obama praised U.S. President Donald Trump, saying: “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 went on to urge Trump to “build more ladders of success for every child and family,” to “sustain the international order” and to protect “democratic institutions and traditions.”

Obama wrote: “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.”

It is customary for presidents to leave notes for their successors. But typically these missives do not come to light so quickly. The handoff letters from U.S. president George W. Bush in 2009 and U.S. president Bill Clinton in 2001 were revealed earlier this year. CNN reports it received the Obama letter from “someone Trump showed it to.”

After taking office, Trump praised the note from Obama, calling it a “beautiful letter” in an interview with ABC. Trump added that he called Obama to thank him for the note.

The White House declined to comment, as did a spokesman for Obama.

In the letter, Obama offered some advice: urging Trump to provide opportunities for those “willing to work hard,” arguing that American “leadership in this world really is indispensable” and asking him to leave “instruments of our democracy at least as strong as we found them.”

Obama also wrote that Trump should “take time, in the rush of events and responsibilities, for friends and family. They’ll get you through the inevitable rough patches.” He concluded by wishing the “very best as you embark on this great adventure.”

Former top Obama aide David Axelrod seized on the letter on Twitter, writing: “What wise and eloquent advice from one president to another. Sad how thoroughly @POTUS has disregarded it!”

Former Republican Sen. Rick Santorum criticized the letter’s opening words, calling it “politically correct” on CNN, though he went on to say the rest was “very gracious and well written.”

In a letter left by Barack Obama for Donald Trump when Obama left the White House the departing president urged his successor to “sustain the international order” and protect “democratic institutions and traditions.”