Barack Obama told an Ottawa crowd Friday that the rise of strongman figures around the world needs to be "combated" with "better stories" being told about human progress.

The former U.S. president also called on social media platforms to "preserve some core social goods," suggesting the public needs to have a "collective conversation" about whether the vast powers of internet giants should be checked.

And he made the case for a strong public sector, saying a thriving civil service and well-funded public infrastructure are necessary for businesses to develop and grow.

Obama was in Ottawa for the first time since 2016. He spoke in a wide-ranging discussion at a Canada2020 event at Ottawa's NHL arena, the Canadian Tire Centre, with Tobias Lütke, the founder and CEO of locally headquartered e-commerce site Shopify.

The talk touched on everything from his memories of his first visit to Ottawa in 2009, and the cookies in his likeness that are still sold in the Byward Market, to reflections on parenting, feminism, his famous 2004 convention speech, his wife Michelle Obama — and the current NBA finals matchup, featuring a Canadian team, the Toronto Raptors, for the first time.

Former U.S. president Barack Obama takes a moment to reflect at Ottawa's Canadian Tire Centre on stage with Tobias Lütke, the founder and CEO of Shopify on May 31, 2019. Photo by Carl Meyer

Often throughout human history, said Obama, "a story tends to rise that is very primal...who's stomping on folks the most." This story, typically "very male," revolves around a "tribal" and "zero-sum contest" of us versus them.

"That kind of politics has gotten traction. That story has gotten a lot of traction around the world," he said. "That, I think has to be combated, with better stories." There's a "better story to be told about human progress," he added, "based on science and facts."

Lütke had provoked Obama's answer by asking about his time right after leaving office. While the former president never spoke about U.S. President Donald Trump directly, he did acknowledge the crowd's reaction at the mere invocation of Trump taking office, saying he knew what everyone was thinking.

Obama said while he believed that the "long term trajectory of humanity is in a positive direction" — echoing the famous quote about the moral arc of the universe bending toward justice — horrible atrocities are also committed throughout history, and "we can't be complacent."

In the context of social media companies, Obama said democracies have difficulty functioning properly "if we don't have some common baseline of what's true and what's not."

The democratic process is being tested by the availability of huge sums of information, he said, that can be easily manipulated. "Part of what we're seeing in our politics right now," said Obama, "is the Fox News viewer has a completely different reality than a New York TImes reader."

Companies such as Facebook and Google now have an "effective monopoly," he said, and they have become "essentially a common carrier of ideas." That situation demands "some sort of collective conversation" about "serving a social function."

"In the absence of watermarks, " said Obama, or "ways of distinguishing truth from falsehood, we have the potential with this splintered media landscape of having basic disagreements not about policy...but just about basic facts."

Obama also said that while it was "legitimate" to question some regulatory structures that are "inhibiting new ways of thinking," the "foundational role" of government is to create a platform for the population to exercise its entrepreneurial talents.

He said when he hears business leaders say "government is the problem," he tells them to visit countries that don't have functioning roads, bridges, or education and court systems, or suffer from bribery or a lack of security.

Canada is an important country to the U.S. not just as a trading partner but as an ally with shared values, said Obama. U.S. power is magnified when it supports alliances with countries like Canada and those in Europe that have a "liberal, small-L, market-based democracy" and a "belief in certain international norms and rules."

As he usually does, Obama spoke highly of his family, joking that Michelle is doing the heavy lifting these days with her bestselling book, and suggesting that their kids are a product of their shared parenting strategy, focusing on values like treating other people fairly.

He said the thing he appreciates the most is Michelle's honesty, and adherence to a core set of beliefs, and said that was the reason so many people also appreciated her.

"Her honest acknowledgement of the strains and challenges of dealing with a society that is still sexist and still grossly inadequate in the way it supports other professional women, and how they balance those extraordinary responsibilities — the way she speaks about that, I think there's a resonance," he said.

Obama didn't spend much time getting into the details of his time in office, and only made passing reference to some of the more contentious fights of his presidency, admitting "there was a time when we fumbled the ball and made mistakes."

But he did not specify what mistakes or battles he was referring to during mandates when his presidency fought to establish Obamacare and suffered a chill in relations with Canada over former prime minister Stephen Harper's push for the construction of TransCanada's Keystone XL pipeline.

Obama then quickly pivoted to leaders needing to have a purpose to their leadership — at a time when Trump has been tweeting about staying in office longer than the constitutionally required two terms.

"If there's not a purpose behind it (public office), then your only purpose is to hang on to that office," Obama said to cheers. "When you see politics fail...it's because it's all been about, 'What I want to be,' and 'I just want to hang on as long as I can.'"

Obama also garnered applause when he said called for a re-think in how young people are educated, to teach them critical thinking, and "experiential learning." An education system with a blackboard and boring teacher may have been good to teach kids to work in a factory or an office in the past but that is no longer adequate.

The visit came one day after U.S. Vice-President Mike Pence was in town on behalf of Trump, who is decidedly less popular in Canada than the 44th occupant of the Oval Office.

Trump has yet to pay a solo visit to Ottawa but his appearance as part of the larger G7 leaders' summit in Quebec last year plunged Canada-U.S. relations to a new low. Tweeting from Air Force One after departing Canada last year, Trump called Prime Minister Justin Trudeau "very dishonest and weak."

Former Newfoundland premier Brian Tobin, who was also a federal Liberal cabinet minister, said Friday's talk contained a warning not to take for granted "all of the privileges we enjoy as citizens in this global community."

"It's a wake-up call from Obama," Tobin said, "done gently, but done very effectively."

with files from The Canadian Press

Typical Obama. Perhaps instead of better stories, his speciality, we could have better deeds?

Today's must read