Sao Paulo, Brazil (CNN) -- A prison riot in Brazil that left four inmates dead came to a conclusion Tuesday after officials transferred all the inmates elsewhere and rioters released two guards they had held hostage.
Brazilian authorities had begun moving inmates out Monday after rioting at the prison in the southern city of Cascavel, where two inmates were decapitated and two thrown off the roof of a cell block. According to the state-run Agencia Brasil news agency, there was a fifth victim, too.
Prisoners, demanding better living conditions and more flexible visiting hours, overpowered guards Saturday at the State Penitentiary in Cascavel. They burned mattresses and damaged cells.
The prison housed just over 1,000 inmates, according to local media reports.
Prison riots are not uncommon in Brazil, often sparked by overcrowding, poor conditions and rivalry between criminal gangs.
CNN's Barbara Arvanitidis and Mariano Castillo contributed to this report.