In his final address to the United Nations, U.S. President Barack Obama called for an end to the persecution of gay people.

Speaking Tuesday at the United Nations General Assembly in New York, Obama said social traditions can be respected and practiced without violence or dehumanizing another group of people.

“I do not believe progress is possible if our desire to preserve our identities gives way to an impulse to dehumanize or dominate another group,” Obama said. “If our religion leads us to persecute those of another faith, if we jail or beat people who are gay, if our traditions lead us to prevent girls from going to school, if we discriminate on the basis of race or tribe or ethnicity, then the fragile bonds of civilization will fray. The world is too small, we are too packed together, for us to be able to resort to those old ways of thinking.”

The outgoing President said a collapse of colonialism and communism style governments around the world is bringing freedom to a new generation.

“In remote corners of the world, citizens are demanding respect for the dignity of all people no matter their gender, or race, or religion, or disability, or sexual orientation, and those who deny others dignity are subject to public reproach,” Obama said.

RELATED: New UN Stamp Supports Gay Rights

First elected in 2008 over fellow U.S. Senators Hillary Clinton and John McCain and subsequently re-elected in 2012 over former Massachusetts Governor Mitt Romney, Obama left no doubts as to his governing philosophy and legacy.

“I recognize not every country is going to follow the same model of governance,” Obama said. “I do not think America can – or should – impose our system of government on other countries. But there appears to be a growing contest between authoritarianism and liberalism right now. And I want everyone to understand, I am not neutral in that contest. I believe in a liberal political order – an order built not just through elections and representative government, but also through respect for human rights and civil society, and independent judiciaries and the rule of law.”

Obama mentioned several of the 193 U.N. member states by name and directed challenging statements to some, including Russia.

“In a world that left the age of empire behind, we see Russia attempting to recover lost glory through force,” Obama said.

RELATED: Openly Gay Candidates Seek Seats In Russian Duma

On the homefront, U.S. Senator Ted Cruz (R-TX) blasted Obama’s speech via Facebook, chalking the occasion up as a missed opportunity.

“Mr. Obama would have done much better to use this opportunity to advance an American agenda, not a global one, and praise our nation as a model of liberty and tolerance,” Cruz wrote. “He should have called out oppressive regimes from the Russian Federation to the People’s Republic of China for denying their citizens basic political freedoms.”

Cruz campaigned for the Republican party’s Presidential nomination, finishing second to New York businessman Donald J. Trump. At the GOP convention in Cleveland, Cruz drew the ire of party faithful when he declined to endorse Trump, instead asking Republicans to “vote your conscience.”