The United Nations Human Rights Council, after long and heated discussions, appointed an independent investigator Thursday to help protect homosexuals and transgender people from discrimination across the world.
The U.N. expert has not yet been named and will have a three-year mandate.
The U.S. and major European countries backed the resolution, along with strong support from Mexico.
"Remember Orlando … Let us give hope to millions," said Mexican Ambassador Jorge Lomonaco told the council, referring to the massacre of 49 people at a gay club in Florida on June 12.
The text said that thousands of people are exposed to violence and discrimination due to their sexual orientation and gender identity.
China, Russia and 16 African and predominantly Muslim states rejected the post. India, South Africa and the Philippines were among the abstainers.
Saudi Arabia was a notable objector the post. Faisal Trad, Saudi Arabia's U.N. ambassador, argued against "the imposition of certain ideas" and said the new post would open up a "Pandora's box" while ignoring cultural and religious specificities.
Pakistan—speaking on behalf of the Organization of Islamic Cooperation and its 57 member states—criticized the new post for the "promoting of certain notions, concepts and lifestyles on which there is no consensus."
After a heated debate lasting almost four hours, the 47-member state body backed the resolution with 23 in favor, 18 against, and six abstentions.
"This Council regularly—and rightly—passes resolutions on racism, women and children. Yet, on this issue, we often hear of culture and tradition as reasons to justify violence against individuals based on their sexual orientation and gender identity," British Ambassador Julian Braithwaite said.
"This affects people in this room, and people in my team who are LGBT. Are you saying it is okay to discriminate against them based on their sexual orientation and gender identity? To hit, torture, or possibly kill them? Because that is what you are supporting, if you vote against this resolution."