The dinner, his eighth, was a chance for the US president to make fun of himself, his colleagues and opponents.
As in previous years, Donald Trump was a regular target, but the favourite for the Republican presidential nomination was not present.
Mr Obama's dramatic exit, featuring a mic drop, gained a standing ovation.
The event was attended by journalists, politicians and film and television stars.
"The Republican establishment is incredulous that he's their most likely nominee. They say Donald lacks the foreign policy experience to be president. But in fairness he has spent years meeting with leaders from around the world: Miss Sweden, Miss Argentina, Miss Azerbaijan."
"Is this dinner too tacky for the Donald? What could he possibly be doing instead? Is he at home eating a Trump steak? Tweeting out insults to Angela Merkel? What's he doing?"
"Foreign leaders they have been looking ahead, anticipating my departure. Last week, Prince George showed up to our meeting in his bathrobe. That was a slap in the face. A clear breach of protocol."
"Ted had a tough week. He went to Indiana... stood on a basketball court and called the hoop a basketball ring. What else is in his lexicon? Baseball sticks, football hats, but, sure I'm the foreign one!"
"The end of the republic has never looked better," Mr Obama told Republican Party Chairman Reince Priebus. "Congratulations on all your success. The Republican party, the nomination process - it's all going great."
"In fact somebody recently said to me, 'Mr President, you are so yesterday. Justin Trudeau has completely replaced you. He's so handsome, he's so charming. He's the future.' And I said: 'Justin, just give it a rest.' "
"Eight years ago I said it was time to change the tone of our politics. In hindsight, I clearly should have been more specific."
"While in England, I did have lunch with her Majesty the Queen. Took in a performance of Shakespeare, hit the links with David Cameron. Just in case anybody is still debating if I'm black enough, I think that settles the debate."
"Obama out." [drops microphone, exits, gains standing ovation]
Democrats and Republicans alike were the target of jokes by President Obama in his last White House Correspondents' dinner before leaving office.