In front of a crowd of 6,000, former U.S. president Barack Obama called on people to hold to their principles while building a better society.

He called on people to set aside fear, mistrust, and anger, and to rely on the same shared values that Canadians and Americans have espoused to achieve unprecedented prosperity over the past seven decades.

"Our freedom, our quality of life in Canada, in the United States, remains the envy of people around the world. That's what was built after World War II, based on not just power, but on principle," said Obama.

While he never mentioned current U.S. President Donald Trump by name, Obama made in clear that by every metric, he felt that Trump was leading the U.S. in the wrong direction.

"In an age of instant information, where TV and Twitter can feed us a steady stream of bad news and fake news, it can seem like the international order we've created is being constantly tested and the centre cannot hold, and that can lead some people to search for control, and they can call for isolationism," said Obama.

"They can try to retreat and suggest that we have no obligations beyond our borders, our communities, beyond our tribes."

However while those feelings are "tempting" Obama said succumbing to that would betray that the U.S. and Canada have thrived specifically because they are nations of immigrants that respect diversity, and that have been willing to work together because of "shared values."

"That's who we are. Look around Montreal," said Obama.

"It's important for us to establish processes to ensure that we reaffirm that we are nations of immigrants, that it creates dynamism in our economies, that it strengthens us rather than weakens us, and it also upholds our tradition of lawfulness."

Pointing to the resolve of citizens of London, Manchester, and other cities in Europe that have been subject to terrorist attacks, Obama congratulated them on their attitudes.

He said that determination, that willingness to maintain a free and open way of life, was the only way to defeat terrorism.

"That is why we will prevail. Because our way of life is stronger if we work at it," said Obama.

He said that he is confident that citizens will reject the "strongmen" that call for isolationism because it's a failed tactic in dealing with terrorists.

Instead, people have to remember that violence is at its lowest point ever.

"If we can shrink the circles of despair and fear... that ultimately is the best security policy we can come up with."

Social safety net

The former U.S. president pointed out several times that while market-based economies have produced amazing prosperity, in recent years that prosperity isn't always evenly distributed.

"It's been clear for some time that the world is an at inflection point," said Obama.

"We can see that that same order is increasingly strained by the accelerating forces of change... These shifts have shaken the foundations of families, community, politics."

He said that citizens have their doubts in the political process, and rightly so.

"The concern among many is that the game is fixed, that their governments are not working for them," said Obama.

His solution, in part, is to ensure that economies are able to lift people up.

"We're going to have to make sure that a high tech economy works for all and not just a chosen few," said Obama.

"If there are not enough ladders of opportunity it destabilizes the economy. This Chamber understands this. Montreal understands this."

He added that Canada solved several of these problems decades ago with single-payer healthcare and a government-backed pension plan.

"We can't reverse progress. We have to build new social compacts to make progress work for everyone... to give workers the power to win better wages... we have to invest in the skills and education and capabilty of our people. We have to modernize the social safety nets that empower them to take those risks," said Obama.

"What's lacking now is political will and vision."

And as that happens on the local level, that also must happen internationally as well, pointing out that trade helps poor people in poor nations get richer, helps stabilize countries, and provides markets to businesses in wealthy countries.

"Making sure that fragile states do not collapse in the first place... it's not just charity, it's the smart thing to do" said Obama.

U.S. abandoning leadership

It was the first speech by Obama since current president Donald Trump announced he was going to pull the U.S. out of the Paris Accord on climate change.

Obama was evidently disappointed by that decision and implied that it would not last.

"Even in the temporary absence of American leadership we will still give our children a fighting chance," said Obama.

He added that multiple cities and states have pledged they will abide by the Accord no matter what the federal government does.

"None of this came about because the United States worked alone."

He added that the ball is now rolling and it only makes economic sense to be environmentally responsible.

"Wal-Mart is not going to change, because they're saving money," said Obama.

On the same day as Obama's speech, Canada's foreign affairs minister said the world can no longer rely on the U.S. for protection.

Chrystia Freeland's announcement is a prelude to a review of defence spending which is expected to make the case for spending billions on Canada's military.

She said given the United States under President Trump no longer wants to be a global leader, it's time for nations around the world, including Canada, to beef up its armed forces.

"Many of the voters in last year's presidential election cast their ballots animated in part by a desire to shrug off the burden of world leadership. To say this is not controversial, it is simply a fact," said Freeland.

She said Canada was grateful for the role the U.S. had played in the world, but understands that Americans must decide for themselves what they wish to do.

In the meantime, Canada can no longer wait.

"To put it plainly: Canadian diplomacy and development sometimes require the backing of hard power," said Freeland.

Post-speech dinner

Obama began his speech by mentioning his personal respect for Canada, including his Canadian brother-in-law.

He also cracked a few jokes, at one point mentioning that there are many Canadians living in America who have a tendency to "sneak up on" Americans.

After the speech, Obama joined Prime Minister Justin Trudeau for dinner at Liverpool House in Montreal's Little Burgundy neighbourhood.