MUKALLA, Yemen — They call it the “grill”: The victim is tied to a spit like a roast and spun furiously within a circle of fire. It is just one of the terrors inflicted by interrogators on detainees in Yemen who are routinely beaten with wires and were kept in filthy shipping containers, blindfolded for months – all by one of America’s closest counterterrorism allies.

Abuse and torture are rife in a network of secret prisons across southern Yemen where hundreds are detained in the hunt for al-Qaida militants, former detainees say. The network is run by the United Arab Emirates and by Yemeni forces it created, with at least 18 lock-ups hidden away in military bases, air and seaports, in the basements of private villas and even in a nightclub, according to accounts from former detainees, families of prisoners, civil rights lawyers and Yemeni military officials.

American defense officials confirmed Wednesday that U.S. forces have interrogated some detainees in Yemen but denied any participation in or knowledge of human rights abuses. The American officials confirmed that the U.S. provides questions to the Emiratis and receives transcripts of their interrogations. A Yemeni witness of American interrogations also said that no torture took place during those sessions where he was present.

Still, the American role raises potential concerns about violations of international law. Obtaining intelligence that may have been extracted by torture inflicted by another party would violate the International Convention Against Torture, which prohibits complicity, said Ryan Goodman, a law professor at New York University who served as special counsel to the Defense Department until last year.

Washington has long relied on allies to help it gain intelligence in the fight against al-Qaida. The UAE has been so key that Defense Secretary James Mattis praised it as “Little Sparta” for its outsized role in fighting the militants. The UAE government has denied that any secret prisons exist or that torture takes place.

At one main detention complex at Riyan airport in the southern Yemeni city of Mukalla, however, former inmates described being crammed into shipping containers smeared with feces and blindfolded for weeks on end. They said they were beaten, rotated on a spit and sexually assaulted, among other abuse. A member of the Hadramawt Elite, a Yemeni security force set up by the UAE, said American forces were at times only yards away.

“We could hear the screams,” said a former detainee held for six months at Riyan. “The entire place is gripped by fear. Almost everyone is sick, the rest are near death. Anyone who complains heads directly to the torture chamber.”

He was flogged with wires, part of the frequent beatings inflicted by guards against all the detainees. He also said he was inside a metal shipping container when the guards lit a fire underneath to fill it with smoke. One fellow inmate tried to slit his own throat; another tried to hang himself, he said.

He and the other former detainees spoke on condition of anonymity for fear of being arrested again. They said that when they were released, Emirati officers forced them to sign a document not to talk publicly about what they had endured.

“When I left the container, it was like escaping death,” he said.

Lawyers and families estimate nearly 2,000 men have disappeared into the system. The Associated Press interviewed 10 former prisoners, as well as a dozen officials in the Yemeni government, military and security services and nearly 20 relatives of detainees.

Ali Awad Habib, a businessman who was detained in the city of Aden, described how he was given electrical shocks on his neck, back, chin and “sensitive parts” of his body, after being imprisoned by the Security Belt, another Yemeni force created by the UAE.

His father, arrested with him in April 2016, was sent to an Emirati base across the Red Sea in the Horn of Africa nation of Eritrea. Yemeni Interior Minister Hussein Arab confirmed that a number of detainees have been sent to the base in the port of Assab.

Chief Pentagon spokeswoman Dana White said the Defense Department has “found no credible evidence to substantiate that the U.S. is participating in any abuse.”

“We always adhere to the highest standards of personal and professional conduct,” she said. “We would not turn a blind eye, because we are obligated to report any violations of human rights.”

However, several U.S. defense officials said senior military leaders are aware of the allegations of torture at the prisons in Yemen and have looked into them. In the end, they were satisfied that there has not been any abuse when U.S. forces are present, the officials said.

The officials said members of the Pentagon’s Joint Special Operations Command or other military intelligence experts participate in interrogations of detainees at locations in Yemen. They said JSOC troops are trained to look for signs of abuss and are required to report it.

The network of Emirati prisons echoes the “black sites,” secret detention facilities set up by the CIA to interrogate terrorism suspects after the 9/11 attacks.