The 193-member General Assembly approved by consensus a resolution calling for an end to fighting around the world from seven days before the Winter Olympics start in Sochi in February until seven days after the Paralympics end in March.
For the first time, according to the United States, the resolution - which has been adopted regularly by the General Assembly for 20 years - called "upon host countries to promote social inclusion without discrimination of any kind."
Russia triggered angry criticism and even calls to boycott the Sochi games when it adopted in June a ban on homosexual "propaganda" among minors. Critics denounced the law as discriminatory and a curb on rights to free speech and assembly.
"Sport embraces all segments of society and is instrumental in empowering people with diverse backgrounds, while fostering tolerance and respect for all people no matter what they look like, where they come from, where they worship or whom they love," U.S. delegate Elizabeth Cousens told the United Nations.
Sochi Games chief Dmitry Chernyshenko said that everyone was welcome at the games at Russia's Black Sea resort.
"During the games we guarantee that there will be no discrimination whether by religious or sexual or gender," he told reporters at the United Nations. "The president of the country three times repeated there will be no discrimination."
Russian President Vladimir Putin said last month that everything was being done "so that participants and guests feel comfortable in Sochi, regardless of nationality, race or sexual orientation.
IOC OPPOSED TO BOYCOTTS
Putin says there is no gay discrimination in Russia, which decriminalized homosexuality in 1993.
But gay people are often blamed for the country's low birth rates and face ostracism from the resurgent Orthodox Church, which has fostered increasingly close ties with the Kremlin during Putin's 13-year rule.
Thomas Bach, the head of the International Olympic Committee (IOC), appealed for the autonomy of sport to be protected and strengthened. He said responsible autonomy meant respecting national laws that do not target sport.
He also said the IOC was opposed to boycotts of any kind.
"Boycotts are a fundamental contradiction to the spirit of sport, depriving it of the means to continue working for peace, mutual understanding and solidarity," Bach said.
"This is even more true if sport is the sole instrument misused for the boycott, while political, economic and cultural relations continue as normal," he said.
Andre Banks, executive director of global gay rights group All Out, demanded Russia repeal its anti-gay propaganda law.
"If the IOC and Russian officials were serious about making the Games open to all, they would take action before Sochi to reject laws that are leading to a dramatic spiral of brutal violence against gays and lesbians," said Banks in a statement.
Australian delegate Tanisha Hewanpola told the U.N. General Assembly that the Olympics had an important role to play in promoting social inclusion by educating people "on such traditional values as respect, diversity, tolerance and fairness and combating all forms of discrimination including on the grounds of sexual orientation and gender identity."
(Reporting by Michelle Nichols; editing by Jackie Frank)