Updated

At the end of the second major Brazilian prison riot in less than two months, police entered a Rio de Janeiro (search) jail Tuesday and found 38 dead inmates, some of them beheaded and others with body parts stuffed in the trash.

The killings at the Benfica (search) detention center during a three-day rebellion came just five weeks after 14 inmates were killed and mutilated in another prison riot — prompting outrage among human rights groups and renewed calls for an overhaul of a prison system long criticized for inhuman conditions.

"In Brazil, we look at pictures from a prison in Iraq and everyone is shocked," said Cecilia Coimbra of Torture Never Again (search), a human rights group tied to the Roman Catholic Church. "People don't realize that this is happening every day in prisons in Rio de Janeiro and other Brazilian states."

The scene at Benfica, where suspects are held while awaiting trial, was so horrific that Rio state legislator Geraldo Moreira said his stomach was turned by the sight of more than two dozen bodies and body parts while he toured the prison with police.

Brazil's prison system "is nothing more than a machine to destroy human lives," he said.

Authorities spent Tuesday securing the detention center for 900 inmates and checking cell by cell to determine a final death toll. Fifteen injured inmates were taken to hospitals.

By nightfall, authorities had still not provided an official list with names of the dead. Some local media put the death toll at 31, lower than the official figure.

The uprising began Saturday when detainees broke through the prison's main gate. As police intervened, inmates attacked and grabbed officers' guns. They took 26 guards and staffers hostage.

The riot ended Monday night when police agreed to inmates' demand to separate prisoners belonging to different gangs.

One prison guard taken hostage was shot and killed as he tried to escape— though there were conflicting reports whether he was shot by inmates or by police who mistook him for a fleeing prisoner.

Investigators suspect rival gangs, who routinely run drug trafficking operations from inside Brazil's prisons, used the chaos of the uprising to settle scores.

Hundreds of relatives of inmates waited hours outside the prison for word on the identities of the bodies. At one point, dozens broke down a schoolyard metal fence next to the prison and surged toward the jail. They were repelled by police.

Rita de Cassia, whose son is an inmate, said she fainted when news emerged of the carnage inside the prison.

"They are telling us absolutely nothing," de Cassia said. "We are desperate for news of the inmates."

Rio de Janeiro state police Maj. Marcelo Parrini said later Tuesday there were no more bodies inside the prison and all of those who were seriously injured had been taken to the hospital.

"We're identifying them one by one from photographs since they destroyed the records in the adminstration office," Parrini said. "That's why it's taking so long."

The weekend revolt came after a five-day rebellion in an overcrowded prison in the Amazon state of Rondonia in April. Rioters decapitated some inmates, stabbed others to death and hung them by their feet from the roof of the prison — and ate cats when the food ran out.

Rebellions and jailbreaks are common in Brazilian prisons, often criticized by human rights groups. An estimated 285,000 inmates are being held in a system built for 180,000.

The country's lockups are rife with gang members, many of whom run drug trafficking empires from behind prison walls using smuggled cell phones. The country's most notorious drug lord, Luiz Fernando da Costa, is accused of coordinating a campaign from inside Rio's Bangu prison to terrorize the city days before its famed Carnival in 2003.

Amnesty International last week issued a report condemning "cruel, inhuman or degrading conditions" in the country's prisons and youth detention centers, citing "overcrowding, poor sanitation, limited access to health services, persistent use of torture, riots and prisoner-on-prisoner violence."

Justice Minister Thomaz Bastos acknowledged past errors and problems with the system but said nothing will be resolved overnight.

"There is no magic formula for rebuilding the nation's prison system. It's the result of many mistakes over many years," Bastos said.

Brazilian politicians rarely heed calls to improve prison conditions, because most Brazilians are fed up with high crime and think criminals deserve harsh treatment.

Andressa Caldas, a leader of the Rio-based human rights group Global Justice, said most Brazilian prisons are staffed by guards with poor training, and prisoners rarely have organized activities to keep them busy.

"Public authorities are not paying attention," Caldas said. "We warned (Benfica officials) weeks ago about putting members of rival gangs in the same prison. Nobody was listening."