With one man nearing the end of his role as national leader and another just beginning, 54-year-old Obama might have been seeing a younger version of himself -- in terms of policy and popularity -- as he welcomed Trudeau to Washington.
The two share a similar world outlook, celebrity appeal and even campaign oratory. The commonalities make for a rare kinship between a foreign leader and the U.S. President, who has often seemed to be a loner on the world stage.
"If geography made us neighbors, then shared values made us kindred spirits," the 44-year-old Trudeau said in a Rose Garden press conference soon after arriving for the first official visit of a Canadian prime minister in 19 years.
And as Obama noted, it's almost hard to tell many of their policies apart. "We've got a common outlook on what our nations can achieve together," Obama said. "He campaigned on a message of hope and of change. His positive and optimistic vision is inspiring young people at home. He's governing with a commitment to inclusivity and equality."
"On the world stage," Obama continued, "his country is leading on climate change and cares deeply about development. So from my perspective, what's not to like?"
State dinner ribbing
The friendly rapport was on display as the two leaders ribbed each other in toasts at a state dinner Thursday night that included wild-caught Alaskan halibut and Colorado lamb chops served with a drizzle of Yukon Jack Canadian whisky.
Obama reminded the guests that "if things get out of hand, remember the Prime Minister used to work as a bouncer." Trudeau cheerfully jabbed back, saying that after seven years as Prime Minister, he hopes his "gray hair comes in at a slower rate" than Obama's.
Publicly, administration officials spoke about the "developing special relationship" between the two.
"They're both young leaders with similar visions of progressive governing," Mark Feierstein, the White House director for the Western Hemisphere, said Tuesday.
Privately, staffers were unusually excited, perhaps even feeling a touch of nostalgia because a charismatic, young leader reminded them of their own, eight years ago.
One senior administration official, discussing the trip, deployed words that quite possibly have never been used to describe the official visit of a foreign leader.
"It's going to be a fun, fabulous visit," this official said. "Trudeau is so incredibly appealing."
The official noted that Trudeau's positions, especially on the environment, were so "in sync" with Obama's.
"You can imagine the celebrations that took place in the White House" when Trudeau won, said Michael Byers, a professor of international politics at the University of British Columbia.
Relief would have been one reason for celebration, said Byers, who noted the difficult relationship between the Obama White House and Canada's previous leader, conservative Prime Minister Stephen Harper.
Harper didn't share Obama's interest in climate change issues and pushed for the Keystone XL pipeline, which would have carried crude oil from Canada to the southern United States. Obama eventually rejected it on climate grounds.
A change in the U.S.-Canada relationship
Byers noted that the Trudeau trip is at the level of an official visit, which involves much more ceremony, including a state dinner.
"Mr. Harper was Prime Minister for nine years and he never received that honor," Byers said. "Mr. Trudeau has been Prime Minister for four months and he's receiving that honor. That speaks volumes."
There are still tough issues to work out, though, among them a longstanding dispute over lumber imports to the United States that Trudeau raised the first time he met Obama, at a conference in Asia, and that came up again at Thursday's press conference.
But the two leaders also have a lot in common, including in their approach to politics. Trudeau even seemed to lift many elements of his election campaign from Obama's electoral playbook.
Like Obama, Trudeau deployed social media to motivate young voters, crushing the competition on election day with thousands more tweeting to @justintrudeau than any of his competitors. Like Obama, the younger man talked to voters about "hope" and "real change." And both have drawn inspiration from a Canadian economist at the University of Ottawa who has researched the ties between income inequality and generational mobility.
Trudeau made it clear Thursday that he'll continue to try to learn from Obama's experience.
"For me to be able to count on a friend who has lived through many of the things that I'm about to encounter on the political stage, on the international stage, it's a great comfort to me," Trudeau said.
Obama on Thursday already began offering the Canadian leader practical advice.
Referring to himself at one point as an "elder statesman," he touched on key lesson he's learned from his time in office -- one that seemed to already be on the younger man's mind.
"If, in fact, you plan to keep your dark hair, then you have to start dying it early," the graying President told the raven-haired Prime Minister. "You hit a certain point, it's too late."