The declaration was cautiously worded, expressing "grave concern" about abuses suffered by people because of their sexual orientation, and commissioning a global report on discrimination of gays. But activists called it a remarkable shift on an issue that has divided the global body for decades, and credited the Obama administration's push for gay rights at home and abroad with helping win support for the resolution.
"This represents a historic moment to highlight the human rights abuses and violations that lesbian, gay, bisexual, and transgender people face around the world based solely on who they are and whom they love," U.S. Secretary of State Hillary Rodham Clinton said in a statement.
Following tense negotiations, members of the Geneva-based U.N. Human Rights Council narrowly voted in favor of the declaration put forward by South Africa, with 23 votes in favor and 19 against.
Backers included the United States, the European Union, Brazil and other Latin American countries. Those against included Russia, Saudi Arabia, Nigeria and Pakistan. China, Burkina Faso and Zambia abstained, Kyrgyzstan didn't vote and Libya was earlier suspended from the rights body.
The resolution expressed "grave concern at acts of violence and discrimination, in all regions of the world, committed against individuals because of their sexual orientation and gender identity."
More importantly, activists said, it also established a formal U.N. process to document human rights abuses against gays, including discriminatory laws and acts of violence. According to Amnesty International, consensual same-sex relations are illegal in 76 countries worldwide, while harassment and discrimination are common in many more.
"The Human Rights Council has taken a first bold step into territory previously considered off-limits," said Graeme Reid, director of the LGBT Rights program at Human Rights Watch. "We hope this groundbreaking step will spur greater efforts to address the horrible abuses perpetrated on the basis of sexual orientation and gender identity."
"Today's resolution breaks the silence that has been maintained for far too long," said John Fisher of the gay rights advocacy group ARC International. "It's clear that the resolution will serve as an entry point for further debate at the United Nations."
The opportunity to do so comes next spring. Friday's resolution called for a panel discussion "to have constructive, informed and transparent dialogue on the issue of discriminatory laws and practices and acts of violence against" gays, lesbians and transgender people.
The prospect of having their laws scrutinized in this way went too far for many of the council's 47-member states.
Speaking on behalf of the Organization of the Islamic Conference, Pakistan said the resolution had "nothing to do with fundamental human rights."
"We are seriously concerned at the attempt to introduce to the United Nations some notions that have no legal foundation," said Zamir Akram, Pakistan's envoy to the U.N. in Geneva.
Nigeria claimed the proposal went against the wishes of most Africans. A diplomat from the northwest African state of Mauritania called the resolution "an attempt to replace the natural rights of a human being with an unnatural right."
Indicating that Washington plans to keep up the pressure on this issue, Clinton said the U.S. "will continue to stand up for human rights wherever there is inequality and we will seek more commitments from countries to join this important resolution."
One of her senior diplomats, U.S. Deputy Assistant Secretary Daniel Baer, told reporters the Obama administration had chosen what he described as a "course of progress" on gay rights, both domestically and internationally.
In March, the U.S. issued a nonbinding declaration in favor of gay rights that gained the support of more than 80 countries at the U.N. This has coincided with domestic efforts to end the ban on gays openly serving in the U.S. military and discrimination against gays in federal housing.
Asked what good the resolution would do for gays and lesbians in countries that opposed the resolution, Baer said it was a signal "that there are many people in the international community who stand with them, and who support them, and that change will come."
"It's a historic method of tyranny to make you feel that you are alone," he said. "One of the things that this resolution does for people everywhere, particularly LGBT people everywhere, is remind them that they are not alone."