Prime Minister Justin Trudeau toasted President Barack Obama "on behalf of 36 million Americans" at Thursday's state dinner, which a top official from his office says was an accident.

"He meant to say Canadians," Mr. Trudeau's principal secretary Gerald Butts told The Globe and Mail.

The line, delivered at the end of Mr. Trudeau's toast, came after a joke about Mr. Trudeau's hair turning grey, and many were still laughing when he made the flub.

Story continues below advertisement

"May the special connection between our two countries continue to flourish in the years to come, and may my grey hair come in at a much slower rate than yours has," Mr. Trudeau told the room, which included U.S. senators, diplomats and Canadian celebrities such as Michael J. Fox and Ryan Reynolds.

"And with that, on behalf of 36 million Americans, I propose a toast to the President, to the First Lady, and to the people of the United States of America. Cheers."

Mr. Trudeau's speech also included references to trade, Syrian refugees and his mother, Margaret, whose last state dinner was in 1977. Mr. Obama also thanked Margaret Trudeau for her work on mental health advocacy, and the room stood up and applauded.

The remarks in the White House east room were a mix of light-hearted and sincere, with Mr. Trudeau referring to the U.S. and Canada as siblings who "took different paths in our later years."

"We became the stay-at-home type and you grew to be a little more rebellious," Mr. Trudeau said, to laughter. Mr. Obama's toast at Thursday's state dinner was filled with jokes about Canadians, including references to poutine, two-fours, double-doubles and of course, Justin Bieber.

"I think it's fair to say that, here in America, you may well be the most popular Canadian named Justin," Mr. Obama said.