A United Nations panel on human rights has for the first time approved a resolution condemning discrimination based on sexual orientation.

The U.S.-backed resolution was approved Friday in the 47-member Human Rights Council with a 23 to 19 vote, with 3 abstentions, the AP reported.

Put forward by South Africa, the resolution commissions a global inquiry into the discrimination and mistreatment of LGBT people.

The U.S. State Department called its passage a “historic step.”

“It calls for reporting on what's going on, where people are being discriminated against, the violence that is taking place, and it really puts the issue squarely on the U.N.'s agenda going forward,” Suzanne Nossel, deputy assistant secretary of state for international organizations, told CNN.

In March, eighty-five countries including the United States issued a non-binding declaration in support of gay rights. The resolution, which expressed “concern at continued evidence in every region of acts of violence and related human rights violations based on sexual orientation and gender identity” and called on counties “to take steps to end acts of violence, criminal sanctions and related human rights violations committed against individuals because of their sexual orientation or gender identity,” was condemned by the Vatican.

Archbishop Silvano M. Tomasi, the Vatican's representative to the U.N. Human Rights Council in Geneva, told diplomats that people who oppose gay rights are at risk of losing their human rights.

“People are being attacked for taking positions that do not support sexual behavior between people of the same sex,” Tomasi said in a statement.

Tomasi also likened being gay to pedophilia and incest.

“States can, and must, regulate behaviours, including various sexual behaviours,” he said. “Throughout the world, there is a consensus between societies that certain kinds of sexual behaviours must be forbidden by law. Pedophilia and incest are two examples.”

Friday's resolution, which also isn't legally binding, was backed by the European Union, Brazil and other Latin American countries. African and Islamic countries, however, condemned the resolution, saying it had “nothing to do with fundamental human rights.”