A new report has found that despite significant progress on gay rights around the world, dozens of countries still criminalise consensual same-sex activity, including six where being gay is punishable by death.
The report by the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA) found "considerable progress" in legal protections for LGBTI people worldwide.
The organisation said that even during the Covid-19 pandemic, which has created significant additional challenges for LGBTI and other minority communities, "positive developments have taken place".
But the report found that while the trend is towards acceptance, a full 69 UN member states continue to criminalise consensual sex between people of the same gender.
That is one fewer than last year, after Gabon backtracked from a 2019 law - "the shortest-lived law of its kind in modern history," ILGA research coordinator and lead author of the report Lucas Ramon Mendos said in a statement.
More urgently than laws on the books, ILGA verified that 34 countries - more than half of those with criminalising laws - have actively enforced them in the past five years.
The report warned the real number could be "much higher".
Mr Mendos said: "Wherever such provisions are in the books, people may get reported and arrested at any time even just under the suspicion of having sex with someone of the same gender."
He said: "Courts actively prosecute and sentence them to jail, public flogging, or even death."
In six UN member states, the death penalty is the legally prescribed punishment for consensual homosexual sex: Brunei, Iran, Mauritania, Saudi Arabia and Yemen, as well as across 12 northern states of Nigeria.
The report also said sources indicated that the death penalty could potentially be used in such cases in five other countries - Afghanistan, Pakistan, Qatar, Somalia and the United Arab Emirates - although there was less legal certainty.
Another 42 countries have put up legal barriers to freedom of expression and sexual orientation and gender identity issues, while 51 have legal barriers to setting up NGOs that work on LGBTI issues.
ILGA's head of programmes Julia Ehrt expressed concern that some governments had taken advantage of the coronavirus crisis to step up efforts to "oppress, persecute, scapegoat and violently discriminate against us."
The organisation also voiced concern over the proliferation of so-called "LGBT-free zones" in places such as Poland and Indonesia, and renewed support for "conversion therapies".
But even as anti-gay rights forces seem to gain ground in a number of places, ILGA said its latest report showed "how our global community has collectively achieved progress in every single legal category tracked".
It highlighted that Sudan in July repealed the death penalty for consensual same-sex sexual acts, and hailed that Germany had become one of four UN member states which ban conversion therapies at the national level.
A number of jurisdictions within Australia, Canada, Mexico and the United States have also done so.
And it celebrated that Costa Rica had joined the growing number of countries that have introduced marriage equality, bringing the total to 28.
It pointed out that another 34 countries provide for some partnership recognition for same-sex couples.
The report also showed that as of this month, same-sex sexual acts are legal in 124 countries - 64% of UN member states.
A full 81 countries, meanwhile, have laws offering protection against discrimination in the workplace based on sexual orientation, ILGA said, pointing out that 20 years ago, only 15 did.
Despite the challenges, Ms Ehrt said the report "contains hope for a better tomorrow (and) a future in which our communities will no longer have to fight to reclaim rights that should have never been taken away from us in the first place".