A court in Uganda granted bail to 39 men on Friday after authorities arrested them at an LGBTQ+ shelter earlier this week, according to local rights groups.
Forty-four men were arrested in Uganda on Monday, said Frank Mugisha, executive director of Sexual Minorities Uganda.
Mugisha said the men had been arrested due to a "negligent act likely to spread infection of disease." He added that almost 20 had been forced to undergo anal examinations.
The action has been condemned by rights groups.
Pan Africa ILGA, a regional chapter of the international organization ILGA, tweeted after the arrests this week, "This is the second shelter being raided in a year. We join our member organizations and human rights defenders in Uganda to urgently call for their release."
International LGBTQ+ rights group Rainbow Railroad posted video of the raid that the organization says features authorities abusing those they are taking into custody. The group tweeted that Ugandan media falsely claimed a wedding for a same-sex couple had taken place.
In early May, the Ugandan parliament passed a bill banning sexual acts between same-sex couples. Those found guilty could face up to 10 years in prison. The nation had been debating criminalization of gay sex for over a decade, at times considering legislation that would have imposed the death penalty in certain circumstances. It eventually adopted a law providing for life imprisonment as the maximum penalty, but it was struck down by Uganda's highest court on a technicality in 2014, and the new bill is designed to replace it. The legislation awaits President Yoweri Museveni's signature.
Even though the measure was supposedly designed to prevent sexual violence, it includes provisions punishing LGBTQ+ people and sex workers, Human Rights Watch said in a statement.
"Ugandan lawmakers should focus on ending endemic sexual violence rather than seeing this as an opportunity to imbed abusive provisions that criminalize the sex lives of consenting adults," said Mausi Segun, Africa director at Human Rights Watch.
"Sexual offenses legislation should advance the rights of survivors and potential victims of violence, not enshrine rights violations into law."