The arrests and torture of LGBT people in these nations violate international law.

United Nations officials have spoken out against what they see as a troubling global trend involving the mass arrests, detainment, and torture of LGBT people.

On Friday, officials said authorities in Azerbaijan, Egypt, and Indonesia had violated international law for committing such actions in recent weeks, reports the New York Times.

In October, authorities in Azerbaijan released around 83 gay bisexual, and transgender detainees, who had been arrested in September. While in detainment, some were subjected to torture such as beatings and shock treatments, said Rupert Colville, from the United Nations High Commissioner for Human Rights, at a Geneva press conference.

Authorities in Baku, Azerbaijan's capital, claimed they detained these people for charges involving sex work, "hooliganism," and "resisting a police order," although lawyers dismissed these claims as pretext.

"Any arrest based on actual or perceived sexual orientation or gender identity is by definition arbitrary and violates international law," Colville said.

In September, Egyptian authorites detained at least 11 men for waving a rainbow flag at a concert, and for using gay meetup apps. Those arrested were subjected to forced anal examinations that are nothing more than torture, reports Amnesty International.

In Indonesia, police arrested around 50 men at a sauna earlier this month, the latest in a string of raids targeting LGBT people that have resulted in arrests, public flogging, and forced HIV tests.

Colville also challenged the truth regarding the charges of sex work — common in all three of these nations against LGBT people — noting that "in almost all cases the accused have denied such allegations or indicated that they were coerced into confessing involvement."

U.N. officials demanded anyone detained due to their LGBT identity in Azerbaijan, Egypt, and Indonesia be released immediately.