In the first address by a United Nations secretary general to an International Olympic Committee (IOC) session, Ban Ki-moon condemned discrimination and attacks on people based on their sexual orientation.
Speaking on the eve of the February 7-23 Sochi Games opening ceremony, Ban said: "Hatred of any kind must have no place in the 21st century."
Russia, hosting a winter Games for the first time, has come under mounting criticism since the government passed an anti-gay propaganda law last year which critics say curtails rights of homosexuals and discriminates against them.
"We must all raise our voices against attacks on lesbian, gay, bisexual, transgender or intersex people," Ban told the IOC session in the Black Sea resort on Thursday.
"We must oppose the arrests, imprisonments and discriminatory restrictions they face."
Russian President Vladimir Putin has defended the law as protecting minors and has said homosexuals will not be discriminated against during the Sochi Olympics.
Ban said sport had the power to further human rights but made no specific reference to the controversial law in Russia or the country itself.
"I know that Principle 6 of the Olympic Charter enshrines the IOC's opposition to any form of discrimination," he said.
"The United Nations stands strongly behind our own 'Free and Equal' campaign, and I look forward to working with the IOC, governments and other partners around the world to build societies of equality and tolerance."
Sochi Games officials have said protests to oppose the law had no place in the city during the Olympics.
U.S. warns about toothpaste bombs
Meanwhile, the United States warned airlines on Wednesday that terrorists may try to conceal explosives in tubes of toothpaste on flights headed to Russia, according to an AFP report.
One official told the news agency there is information "specifically targeting flights to Russia."
A Department of Homeland Security statement said that it shares relevant information with partners in the U.S. and abroad "out of an abundance of caution," AFP reported.
The Northern Caucasus region, which is close to Sochi, is the site of fighting between Russia and Islamic militants. Suicide bombings that killed 34 people in the city of Volgograd in December raised fears of further violence before the Sochi Winter Olympics. Militants have threatened to strike Russian targets during the games.
Two U.S. warships have arrived in the Black Sea ready to help in case of a security emergency at the Sochi Olympics, AFP said. Around 40,000 members of Russia's security forces have been deployed in around Sochi ahead of the games, which open Friday.
Want to enjoy 'Zen' reading - with no ads and just the article? Subscribe todaySubscribe now