WASHINGTON — President Obama on Thursday said the United States and Canada were more closely aligned than ever, using a meeting with Prime Minister Justin Trudeau to announce joint efforts to curb emissions of planet-warming gases and to promote his personal rapport with the leader of a pivotal neighbor.

Mr. Obama played the older, more experienced host to Mr. Trudeau’s fresh-faced newcomer during the visit, the first official one by a Canadian leader in 19 years, as the two announced that they were teaming up to reduce the release of methane, a chemical contained in natural gas.

“He campaigned on a message of hope and of change; his positive and optimistic vision is inspiring young people,” Mr. Obama said at a news conference in the White House Rose Garden, drawing unmistakable parallels between Mr. Trudeau’s rise to power and his own. “On the world stage, his country is leading on climate change and cares deeply about development, so from my perspective, what’s not to like?”