President Barack Obama squeezed in a Justin Trudeau joke at his final White House Correspondents' Dinner roast.

Obama made a few cracks about how he'd aged during his eight-year presidency, referring to his new grey hair and how he'd have no trouble being awake for a 3 a.m. phone call because of his frequent toilet breaks.

Then came an aside about Canada's new prime minister, whom he hosted at a state dinner last month.

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

Obama then delivered the presidential punch-line, waving dismissively: "I said, 'Justin, just give it a rest.'"

Video of President Barack Obama's final White House Correspondents' Dinner speech. White House YouTube video..

The annual correspondents' dinner features a brief monologue where presidents get to try their hand at stand-up comedy.

Obama made a number of jokes about the current U.S. election.

He teased the Republican party, mocked the media for giving Donald Trump so much airtime, and referred to the impending demise of the American republic.

But he joked that Hillary Clinton's victory was a foregone conclusion. He noted that someone else would be standing in his spot next year, deadpanning: "It's anyone's guess who she will be."

Obama also referred to his recently improved approval ratings. As he pretended to consider what was the cause of his recent spike, photos flashed upon the screen of Trump and rival candidate Sen. Ted Cruz.

"Last time I was this high," Obama said, "I was trying to decide on my major."

The Canadian Press