The president held up random words on cue cards while Lin-Manuel Miranda kept the rhymes flowing. Then at the end, they had a "drop the mic" moment.
The White House posted video of all the fun on its Twitter account on Monday, the same day the "Hamilton" cast visited. Social media users followed along with Bam4Ham.
The cast lead students through an acting workshop and gave a one-of-a-kind performance rich with symbolism and a touch of irony.
The Broadway show captures the story of our nation's founding father, Alexander Hamilton.
Told by a talented African-American and Latino cast, the score ranges from hip-hop and R&B, to jazz and the blues - all to bring history to life in a very unique way.
On Instagram, the castmembers showed their gratitude for the big day, expressing thanks to the president and first lady.
As for the show, after years of development, "Hamilton" debuted at the Public Theater in New York City early last year and moved to Broadway in August.
It has since become a world-wide phenomenon - and eager Angelenos will have a chance to enjoy the musical next year. "Hamilton" will play at the Pantages Theatre in Hollywood Aug. 11 - Dec. 30, 2017.