Justin Trudeau's first speech to the United Nations General Assembly included some less-than-subtle references to the politics practiced by people like Donald Trump, in a year where populist nationalism has made gains in different countries.

The prime minister never mentioned any names, yet warned three times in his speech about politicians who exploit anxiety for personal gain. Politicians have a choice to make, Trudeau said: stoke public angst because it works for them politically, or try alleviating it with policies that improve people's lives.

He cast his government's spending-heavy program as the latter — with an infrastructure plan that he's convinced will create middle-class jobs.

"What is the alternative?" Trudeau asked.

"To exploit anxiety? To turn it into fear and blame? To reject others because they look, or speak, or pray differently than we do?"

In a news conference, Trudeau denied referring specifically to one politician. The phenomenon of foreigner-blaming has emerged in different countries, he explained — including in Canada's last election, where he accused his rivals of running on "Islamophobia.''

His message was similar to that of Barack Obama.

Before Trudeau delivered his first UN address, the U.S. president gave his last. He defended globalization; derided walls between nations; and encouraged policies that allow working people to experience the benefits of the global economy.

"Today, a nation ringed by walls would only imprison itself," Obama said — one of three references to walls in his speech. "So the answer cannot be a simple rejection of global integration. Instead, we must work together to make sure the benefits of such integration are broadly shared."

He cited several policies that might reassure working people that the globalized economy isn't rigged against them: unionization, cracking down on tax havens, and a social-safety net that allows people to retrain for new jobs.

Obama also described foreign aid as one of those tools to narrow inequality — not within countries but between them.

"A world in which one per cent of humanity controls as much wealth as the other 99 per cent will never be stable," he said. "A pervasive sense of injustice undermines people's faith in the system."

He took a shot at the notion of trade wars, a solution suggested by populists like Trump. Tit-for-tat tariff spats would only impoverish the world and increase the likelihood of conflict, Obama said.

Trudeau and Obama apparently didn't discuss their speeches beforehand. One official said any similarities simply stemmed from coincidence and a shared worldview.

That level of agreement was illustrated later in the day during a discussion on refugees, where Obama saluted Trudeau: "I want to personally thank Chancellor Merkel and Prime Minister Trudeau and the people of both those countries, because the politics sometimes can be hard (on accepting refugees). But it's the right thing to do."

Polls in recent weeks have shown a tightening race in the U.S., where Trump has suddenly appeared competitive in surveys nationally and in battleground states. His win in the Republican nomination race comes in a year where other anti-globalization politicians have achieved success in several European countries.

While they differ in myriad policy areas, common themes shared by Trump and parties like France's Front National include opposition to trade deals, complaints about foreigners taking jobs, and advocating a harder line against radical Islamists.

There's an active debate among American pundits about what's driving Trump's voters — anxiety about economics, as Trudeau suggests; culture and race; or a combination of factors, including frustration with run-of-the-mill politicians.

Surveys have given reason to competing theories. They indeed show Trump doing better with voters who are less affluent and less educated. They also show greater resentment toward racial minorities.

This was Trudeau's third trip to the UN this year, as he builds the campaign for a temporary security-council seat.

He was asked why he wants that seat — and what agenda items he'd use it to promote. Trudeau didn't offer any specifics. He referred to championing diversity, and economic opportunity.

He did promise more specifics this fall in one other area: on his promised deployment of 600 Canadian soldiers to peacekeeping operations.

The prime minister received warm applause at his various events, and even some shouted cheers as he arrived in the main conventional hall Tuesday.

However, in another respect, the room was similar to the one that last greeted his predecessor Stephen Harper and Britain's new prime minister, Theresa May, who spoke just before Trudeau: There were more empty seats than people, as various delegations dealt with their own UN meetings and events outside the main hall — which is the custom at the annual event.

Trudeau's allies had poked fun at Harper for that.

Keep reading