(CNN) President Barack Obama stopped by "The Tonight Show with Jimmy Fallon" Thursday night and marked the history of his presidency with a small first step: writing thank you notes.

As emotional piano music -- "thank-you-note-writing music," per Obama's request -- tinkled in the background, the president and late night host took turns "thanking" all the people, places and things that came to shape his presidency.

"Thank you, my 2008 slogan 'Yes We Can' -- or as I now like to call you, 'Yes We Did,'" Obama began.

Fallon wrote next, "Thank you, President Obama's birth certificate. He used to carry you around to prove he was American, now he needs to carry you around to prove he's only 54!"

The president also managed to jab Republicans over Donald Trump in a thank you note to Congress: "Thank you, Congress, for spending eight years wishing you could replace me with a Republican. Or to put in another way, how do you like me now?' he joked as a picture of the presumptive Republican nominee appeared on screen, drawing big laughs.

Read More