Updated

Laws criminalizing consensual gay sex have been scrapped in about 25 countries in the last 20 years, but more than 70 nations still have such prohibitions, a U.N. expert said Friday.

And in many places around the world, lesbian, gay, bisexual and transgender people live in "a crucible of egregious violations" of human rights, enduring violence and discrimination, said Vitit Muntarbhorn, the U.N.'s first-ever independent expert investigating violence and discrimination based on sexual orientation. The world body's Human Rights Council appointed him last year, in a move that met significant opposition amid deep international divisions on gay rights.

Addressing a General Assembly committee for the first time Friday, Muntarbhorn noted "a global trend toward decriminalization of consensual same-sex relations." At least five countries — Belize, Lesotho, Mozambique, Palau and Seychelles — have scrubbed such laws just in the last five years.

"The gaps are, however, ubiquitous," Muntarbhorn added.

Besides the dozens of countries where it's a crime — sometimes punishable by death — for people of the same gender to have sex, some countries also have criminal laws aimed at transgender people.

While some laws are rarely applied, they still fuel other forms of discrimination, Muntarbhorn said. He called for reforming all criminal laws against same-sex relations and for establishing more anti-discrimination laws.

Muntarbhorn's job became a flashpoint last year, when African nations tried to stop his work. They questioned its legal basis and said the U.N. was delving into national matters and prioritizing LGBT issues over discrimination based on race or religion.

A proposal to suspend Muntarbhorn ultimately lost a General Assembly vote, 77-86, with 16 abstentions.

His work has continued to face headwinds: Few countries have responded when contacted about alleged rights violations, Muntarbhorn said, adding that all details of the communications were confidential.

"Precisely because this mandate was so heated, so caustic, from the beginning, my humble intention during this year was to calm the situation through quiet engagement," said Muntarbhorn, a Thai law professor who has served in other U.N. posts. He's resigning from his unpaid expert position as of Tuesday, citing illness in his household.

His successor is to be named in December.