OTTAWA -- Prime Minister Justin Trudeau says governments need to be wary of taking steps to regulate social media platforms that could be used by authoritarian regimes to further oppress citizens and stifle free speech.

As momentum builds around the globe for regulating tech titans like Facebook and Google, Trudeau made it clear Wednesday that he sees government intervention as a last resort.

He made his case at the kick-off of the Open Government Partnership Summit, a gathering of civil society and government representatives from some 100 countries aimed at promoting more open and transparent governments around the globe.

Among other things, the three-day summit, being hosted by the Canadian government, is to consider ways to combat bad actors who use the internet to spread hatred and extremism, exacerbate societal divisions, sow distrust in democratic institutions and manipulate election outcomes.

Trudeau argued that government regulation is not the solution. Rather, he said the solution lies in governments working with tech giants and citizens to rein in the worst aspects of social media.

"Fundamentally, we can't look at platforms as automatic antagonists. We recognize the solution doesn't lie in government's heavy hand over our internet, over our public spaces," he said during a conversation with Liz Plank, a journalist with online media outlet Vox.

"What tools a reasonable, democratic, open government like Canada or others might find extremely useful and good to have on protecting citizens and encouraging competition and assuring that platforms take their responsibility seriously, in a different country might be a tool for oppression of citizens or control or really attacking free speech."

Trudeau added that freedom of speech "is so fundamental to our democracies ... there are some really tricky decisions we have to have and we have to have them in conversation."

A few hours earlier, politicians from Canada and about a dozen other countries wrapped up a three-day gathering in Ottawa aimed entirely at coming to grips with the potential harms social media causes to democracies. The consensus of those who took part -- including representatives from Canada's three main federal parties -- was that the tech giants can't be trusted to regulate themselves and it's time for government's to compel them to clean up their act.

Among other things, members of the grand committee on big data, privacy and democracy issued a summons to Facebook executives Mark Zuckerberg and Sheryl Sandberg, who did not accept an invitation to appear as witnesses.

But Trudeau didn't join the pile-on. Instead, he argued that he's found the tech sector to be receptive to self-regulation, recognizing that users will eventually delete their accounts if platforms become "pools of toxicity."

"When you see a toxicity beginning to spread on platforms, a lot of good people step away from those platforms and you end up with just pools of toxicity that people will find other ways of having these conversations. So it's very much in the tech sector and platforms' interest to try and make sure that they're creating spaces that are valuable to citizens and community."

Trudeau said he's prepared to impose regulations if the tech titans don't take it upon themselves to resolve the problems.

"I'd much rather do it in partnership with platforms but, if it comes down to it, we will take measures that we will regret having to take because our imperative is to keep citizens safe."