BRASILIA, Brazil (AFP) - Brazilian authorities reached a deal with rioting prisoners on Monday who killed four fellow inmates, beheading two of them, and held two guards hostage.
Elson Faxina, a spokesman for the Parana state attorney's office, said an agreement was signed to end the uprising at the Cascavel city correctional facility and that prisoners were currently being transferred to another jail.
"After that, the two guards who were held hostage will be freed," Faxina said, adding that police still had to enter the jail to assess the damage and determine if there are more victims.
Some 800 inmates - or 80 per cent of those being held at the facility - took part in the revolt, he said.
The riot erupted Sunday as breakfast was being served, with inmates overpowering guards.
Two prisoners were beheaded in the first surge of violence, and two others were thrown off the top of the cellblocks.
The guards were taken hostage in the melee.
An official with the guards' union said only 10 wardens were on duty at the time.
Prison authorities said the inmates were demanding improved facilities, better quality food and more flexible visiting hours.
But the inmate-on-inmate violence also suggested that rivalries between competing prison gangs played a role in the uprising.
"The fact that prisoners took hostages would reinforce that view," Faxina said earlier.
Television images had shown some of the rioting inmates - dressed in orange jumpsuits with their faces obscured - on the roof of the facility during the mutiny.
Police have yet to identify the four inmates who were killed and retrieve the remains of the two who were beheaded, according to authorities.
The state correctional centre, which houses 1,140 inmates, has a capacity for 1,181, according to official data.
Anthony Johnson, president of the prison guard union in Parana state, said the true capacity of the facility was just 900.
"So there's overcrowding," he said. "For us, the situation is tense now but we hope it is resolved. A jail of this kind needs investment."
According to the union of prison workers, a major lack of investment plagues the system, and the facility was threatened by a scarcity of operational and technical professionals as well as proper maintenance.
"Many times the workers have to invest their money to buy the necessary items to do their jobs," the union said in a statement.
"Without investment, we are always exposed to this. The prisoners claim that food is bad, that there are no lawyers to process things, minimal hygiene products don't exist, there are few correctional officers. All the factors together are a tragedy waiting to happen."
Brazil holds 548,000 inmates in its prisons, but needs 207,000 more spaces to avoid overcrowding, according to the NGO Conectas Human Rights.