A 30-hour prison house melee that ended claimed the lives of 18 inmates at the Sao Luis jail in the northern Brazilian state of Maranhao.
The fight broke out on Monday between rival gangs of inmates.
The state government confirmed 15 deaths in Sao Luis, and authorities confirmed that three others had died in the Pedrinhas jail, part of the same complex.
The state's public security ministry said leaders among the prison gangs released five prison guards who had been taken hostage early on Monday at the Sao Luis maximum-security jail.
Although the guards released Tuesday were unharmed, a guard released had been seriously injured, although the wounds were not life-threatening, a local hospital said.
Maranhao media said the atmosphere had been tense for weeks in the jail, and got worse in recent days due to erratic water supply.