At least 17 inmates died in two separate Brazilian penitentiaries in clashes between rival gangs, and authorities were investigating a possible connection between the uprisings, police said Monday.
Violent fighting occurred at the overcrowded Agricola de Monte Cristo prison in Boa Vista, capital of the northern state of Roraima, on Sunday.
At Monte Cristo 1,400 inmates were being held in a prison which was supposed to have a capacity of half that figure.
Instead, special operations police stormed the prison, freed the hostages and regained control of the site by sundown.
The head of the union of penal workers of the state of Romaira, Joana Moura, told the local newspaper Folha de Boa Vista that the riot reflected the "lack of interest from the state government" to address problems in the prison system.
The state's justice secretary Uziel Castro says in a statement that seven bodies were piled up and burned after the Sunday prison mutiny.
The prisoners were armed with knives and wooden sticks, a witness said.
"Every penitentiary system in Brazil was aware that something was about to happen", he told a news conference.
Brazilian sociologist Camila Nunes Dias said the PCC, based in Sao Paulo, and the CV, based in Rio, had split the drugs and arms trade for two decades.
Almost 1,500 inmates were in the jail, which only has a capacity of 700.
Brazil has the world's fourth largest prison population (622,000) behind the United States (2.2m), China (1.6m) and Russian Federation (645,000), according to World Prison Brief, and is home to some of the world's most risky prisons.
Human Rights groups have long complained about the deplorable conditions in Brazilian prisons.
However the inmates demanded a judge to hear their demands.