Former American president Barack Obama offered words of encouragement to Canadians worried about the cross-border relationship when he spoke to an audience in Toronto on Friday.

He was asked during a lunchtime event at a convention centre for some advice and words of wisdom, given what's transpired between the two countries since Donald Trump took over in the White House in January.

The softwood lumber dispute, NAFTA negotiations and protectionist trade measures are among the current irritants in the bilateral relationship, not to mention this week's battle between aerospace giants Boeing and Bombardier.

"Canada, I think you guys are doing great," Obama responded, earning a round of applause from the huge crowd.

"I think in many ways the relationship between our two countries has not radically changed," he said. "There is probably a different conversation taking place between governments, but the connections that we have between people, our commercial bonds, our cultural bonds, are so deep that they transcend any particular party and they transcend any particular moment."

Obama joined Prince Harry on day 7 of the Invictus Games Friday in Toronto. (Chris Jackson/Invictus Games Foundation/Getty Images)

He referred to Prime Minister Justin Trudeau as "Justin" several times and said the prime minister represents a "wave of young leadership" that believes in traditional values of democracy but is trying to adapt creatively to "a dynamic and disruptive time." The former president said he'd like to see more of that kind of leadership around the world.

"It is not enough for us to look backwards and just settle on the traditional recipes of the progressive movement because the world is changing rapidly," he said.

Obama's visit on heels of Clinton's

Obama was invited to speak in Toronto by the think-tank Canada2020, and he packed the room with an estimated 3,000 people. The event attracted Obama fans, some of whom dabbed at tears in their eyes when a video showcasing Obama's time in the White House was played, and politicians from all levels of government.

Obama told a convention centre audience Friday that Canada-U.S. relations haven't radically changed since he left office. (Meagan Fitzpatrick/CBC)

Federal Finance Minister Bill Morneau attended, as well as Ontario Premier Kathleen Wynne and Toronto Mayor John Tory.

Obama's visit came just hours after Hillary Clinton, his former secretary of state and the woman who tried to succeed him, landed in Toronto as part of her book tour.

Clinton shared her post-election feelings and assessments of the 2016 campaign on Thursday night with more than 5,000 people who bought tickets to hear her speak.

Obama did not spend much of his time dwelling on the election loss or blasting Trump the way Clinton did, and barely made reference to the current occupant of the White House.

Instead, he talked about the challenges of globalization and automation and the need to make sure the economies in the U.S. and Canada are working for everyone, and not just a few. Other challenges, such as climate change, require strong international co-operation, he said.

Paris climate accord will survive

On the international Paris climate change agreement, which he helped forge and Trump is pulling out of, Obama said he is confident it will survive even without U.S. participation.

"Everybody else is still part of the Paris accord right now," he said.

Obama meets competitors from the U.S. team at the Invictus Games. (Chris Jackson/Invictus Games Foundation/Getty Images)

On other foreign policy issues he called North Korea "a real danger," and said addressing it requires strong diplomacy and not just a military strategy.

He also talked about the need to recognize the benefits of refugees and immigrants, lauding Toronto's diversity and that of his adopted hometown of Chicago, but said people also need to recognize that some fear immigrants because of their impact on jobs and wages.

Obama also emphasized the need to recognize how technology is making it easier for people to retreat into "information bubbles," in which too often they only listen to those who think the same way instead of hearing opposing opinions, finding compromise and trying to build bridges.

"You will notice America is not bridging a lot of those differences right now," he said.

But Obama said he is a "congenital optimist" and that he is now working on a new foundation that is particularly focused on inspiring young people to become civically engaged. These future leaders will effect social change, he said.

"We'll start building this wave of hope," he said.

Obama with former U.S. presidents George W. Bush and Bill Clinton greet spectators at the Presidents Cup at Liberty National Golf Club in Jersey City, N.J., Thursday, Sept. 28, 2017. (Julio Cortez/Associated Press)

Since leaving office in January, Obama and his wife, Michelle, have been working on the foundation, unwinding on yachts with celebrity friends, vacationing and giving speeches around the world. The couple are still living in Washington while their younger daughter, Sasha, finishes high school.

Obama is also recovering from dropping his older daughter, Malia, off at Harvard to begin college a few weeks ago. He told an audience on Monday in Delaware that it was "a little bit like open-heart surgery."

"I was proud that I did not cry in front of her," he said.

This is Obama's second visit to Canada since leaving the White House. He was in Montreal in June for a speech and then dined afterward with Trudeau.

After Friday's speech in Toronto, Obama was expected to attend some Invictus Games events to cheer on Team U.S.A.