President Barack Obama addresses the United Nations General Assembly in New York. REUTERS/Kevin Lamarque President Barack Obama took a subtle swipe at Donald Trump and right-wing politics in the final United Nations General Assembly address of his presidency, on Tuesday morning.

Obama presented the different visions for the future that political parties both in the US and abroad are laying out.

"Alternative visions of the world have pressed forward, both in the wealthiest countries and in the poorest," Obama said. "Religious fundamentalism. The politics of ethnicity or tribe or sect. Aggressive nationalism. A crude populism, sometimes from the far left, but often from the far right, which seeks to restore what they believe was a better, simpler age free of outside contamination."

He continued: "We cannot dismiss these visions. They are powerful. They reflect dissatisfaction among too many of our citizens. I do not believe those visions can deliver security or prosperity over the long term, but I do believe that these visions fail to recognize, at a very basic level, our common humanity."

Trump, the Republican presidential nominee, has often been criticized for what some see as a campaign message of divisiveness. His "America first" slogan is seen by some as nationalistic.

Obama also implicitly dismissed the idea, often espoused by Trump, that globalization is killing the US economy. He also took a shot at the notorious wall Trump has said he would build along the southern border of the US to prevent illegal immigration.

"I believe that the acceleration of travel and technology and telecommunications, together with a global economy that depends on global supply chains, makes it self-defeating, ultimately, for those who seek to reverse this progress," Obama said. "Today, a nation ringed by walls would only imprison itself."

He seemed to be speaking to Trump supporters when he cautioned against rejecting globalism and migration.

"It's a truism that global integration has led to a collision of cultures. Trade, migration, the internet, all these things can challenge and unsettle our most cherished identities," Obama said. "And in Europe and the United States, you see people wrestle with concerns about immigration and changing demographics, and suggesting that somehow people who look different are corrupting the character of our countries."

Obama has become more outspoken about Trump in recent months as he campaigns for Democratic nominee Hillary Clinton.