A prison riot in the northeastern Brazilian state of Sergipe ended Monday after the inmates released all 141 hostages after lengthy negotiations, regional officials said.
About 400 prisoners at the Advogado Jacinto Filho de Arcaju prison rioted Sunday morning during visiting hours over complaints about mistreatment by guards and bad food.
Police said the inmates were armed with knives and three rifles stolen from a weapons room inside the prison.
The rioters set mattresses ablaze and demanded better food.
All but three of the hostages were relatives of the prisoners, including many women and children, who were visiting when the uprising broke out. Three guards also were among the hostages, police said.
"After 24 hours of negotiations, the rebellion reached its end," the state of Sergipe Office of Public Safety said in a statement.
Most of the inmate demands could be met only by the court system, state Public Safety Secretary Joao Eloy told reporters.
"We did all that was possible and reasonable and will investigate their complaints," Eloy said.
However many of the inmate demands, including removing the prison warden, were unacceptable.
The five ringleaders were moved to a different prison, Eloy said.
Electric power to the prison was shut off late Sunday but restored three hours later as negotiations were under way, police said.
As in many other Latin American countries, Brazil's prisons are overcrowded, plagued by deteriorating conditions, corrupt officials and criminal gangs who impose their own rules on the inside.