BAGHDAD — Iraqi men held for months at a secret prison outside Baghdad were systematically tortured and forced to sign confession statements that in at least some cases they were forbidden to read, according to a report released Wednesday by a leading human rights group.

Some of the detainees were beaten by Iraqi guards so badly they lost teeth and urinated blood for days afterward, said the report by New York-based Human Rights Watch. Others were raped, given electric shocks on their penises and deprived of air, the report said.

The Iraqi government quickly shut down the prison after the torture was revealed last week, and either released or transferred its 431 detainees. The government also vowed to investigate the abuses, and three army officers have been arrested in connection with the case.

The report of horrific beatings and torture at the Defense Ministry-run secret facility at the old Muthanna airport in west Baghdad has angered the country’s Sunni population, who see it as another example of persecution at the hands of Iraq’s Shiite-led government. It also shocked many Iraqi and U.S. officials, harkening back to images of the abuses of Iraqis by U.S. guards at the Abu Ghraib prison that inflamed insurgents and tarnished America’s image worldwide.

No Americans were involved in the secret prison, part of a row of barracks on an Iraqi army base at the Muthanna airport. Officials said the U.S. Embassy in Baghdad first learned of it within the past month and leaned on Prime Minister Nouri al-Maliki to shut it down.

“What happened at Muthanna is an example of the horrendous abuse Iraqi leaders say they want to leave behind,” Joe Stork, deputy Middle East director at Human Rights Watch, said in a statement late Tuesday. “Everyone responsible, from the top on down, needs to be held accountable.”

Calls for comment to two Iraqi government spokesmen were not immediately returned Wednesday.

The prisoners, all believed to be from the northern Iraqi province of Ninevah, were arrested last fall and accused of aiding and abetting terrorism.

Human Rights Watch interviewed 42 of the detainees after they were transferred to the Al-Rusafa Detention Center in eastern Baghdad, many of them with fresh scars and injuries, and called their accounts of being tortured “credible and consistent.”

A 24-year-old detainee with severe leg injuries lost several front teeth in beatings and still wets his bed after being sodomized with a broomstick and a pistol, the report said.