CAIRO — Their mothers and sisters cried with joy and women from the neighborhood ululated as 46 Yemeni detainees walked free on Tuesday after months or years spent in detention in one of several prisons controlled by the United Arab Emirates in southern Yemen.

It was the third batch of prisoners released after The Associated Press revealed that hundreds of Yemenis swept up in anti-terror raids by Emirati-backed forces have been subjected to torture and sexual abuse aimed at brutalizing the detainees and extracting "confessions" as part of a U.S.-backed anti-terror campaign.

Images posted on social media show the freed men grinning and flashing V signs for victory as their loved ones and neighbors hugged and kissed them in the southern port city of Aden.

The saga of the detainees from the Beir Ahmed prison in Aden is linked to the brutal civil war that has roiled the Arab world's poorest country, where a Saudi-led coalition, of which the UAE is a leading member, is at war with Iran-aligned rebels known as Houthis, who control the capital.

Prosecutor Mohammed Ali Saleh confirmed the release of the 46 on Tuesday, without elaborating, while the detainees themselves gave The Associated Press a list with their names.

Among them was 23-year-old Saddam al-Azazi, held since June of last year. His mother said she fainted when she heard the news and that her daughters had to carry her to see him.

"I walked two steps and my legs couldn't carry me anymore," she said, declining to give her name, fearing for her family. "When my son hugged me, all the neighbors in all the houses were ululating and crying at the same time."

Other prisoners despaired at not being included among those released, with one trying to kill himself by taking pills, according to two witnesses who spoke to the AP on condition of anonymity out of fear of reprisals. Prison officials could not immediately be reached for comment.

According to AP reporting, in an incident on March 10, inmates in Beir Ahmed were forced to undress as Emirati officers searched their anal cavities, claiming to be looking for contraband cellphones.

Drawings smuggled out by a Yemeni detainee at Beir Ahmed gave a grim glimpse into a hidden world of flagrant human rights abuses by UAE officers acting with impunity in several other prisons.

The drawings — made on plastic plates — show a man hanging naked from chains while being subjected to electric shocks, another inmate on the floor surrounded by snarling dogs as several people kick him, and graphic depictions of anal rape.

Another mother said she was "extremely happy" to see her son released, but that he was limping and suffering from back pain. She did not provide further details, and spoke on condition of anonymity, fearing retribution.

Her son has been in detention since March last year. She said a prosecutor ordered him and the other prisoners freed three months ago, but the order was only carried out Tuesday.

Families in Aden and the southern city of Mukalla have been holding near daily demonstrations calling on the coalition to implement the prosecutor's orders and free their sons after they were cleared of any accusations. A father of one of the detainees showed the AP a document from the state prosecutor instructing other prosecutors to implement the release order.

The UAE has denied it runs prisons in Yemen, insisting the Yemeni government is in full control. But Yemen's Interior Minister Ahmed al-Maysari says he has no control over the prisons.

The AP first asked the Pentagon about the abuses a year ago, but despite reports of torture documented by the AP from former and current detainees, human rights groups and the United Nations, the Pentagon said the United States has seen no evidence of detainee abuse in Yemen. U.S. officials have acknowledged that American forces receive intelligence from UAE partners and have participated in interrogations in Yemen.