Sixteen prisoners were decapitated and dozens more also died in a mass prison riot in Brazil.

Some were asphyxiated by other inmates in the latest in a series of deadly clashes involving rival criminal gangs.

As a huge fight erupted, the gangs took at least two officers hostage and set part of the prison on fire, preventing guards from entering parts of the building for about five hours.

More than 52 inmates were killed, and the total number of victims at the Altamira prison in the northern state of Para could rise, authorities said.

Sargento Fahur, a former police officer now high-profile politician, tweeted he was worried about the guards, not the prisoners.

Brazil dam collapse leaves town buried in waste Show all 7 1 /7 Brazil dam collapse leaves town buried in waste Brazil dam collapse leaves town buried in waste A building lays in ruins after a dam collapsed in eastern Brazil. AP Brazil dam collapse leaves town buried in waste A road near Brumadihno is blocked by waste. AP Brazil dam collapse leaves town buried in waste An aerial view of the burst dam in eastern Brazil. AFP/Getty Images Brazil dam collapse leaves town buried in waste The flow of waste spread from the dam to a nearby village. AP Brazil dam collapse leaves town buried in waste A firefighters' helicopter hovers as rescuers work in the search for victims AFP/Getty Images Brazil dam collapse leaves town buried in waste An aerial view shows flooding triggered by a dam collapse near Brumadinho. AP Brazil dam collapse leaves town buried in waste An aerial view after a dam collapsed near Brumadinho, Brazil. AP

"In these fights between criminal factions, I root for the machete. At least 52 vagabonds to make good people hell," he said.

Brazil’s jail population has surged eight-fold in three decades to around 750,000 inmates – the world’s third-highest tally - and its prison gangs have come to wield vast power that reaches far beyond prison walls.

Jair Bolsonaro, the country’s far-right president, says he wants to impose tighter controls in the country’s prisons, as well as building many more of them.

His ability to curtail violence, however, may be limited because most prisons are controlled at the state level.

In January 2017, nearly 150 prisoners died during three weeks of violence in several prisons as local gangs backed by Brazil’s two largest drug factions attacked one another.

Gruesome deaths are not uncommon. In May, at least 15 inmates were found dead, choked to death or stabbed with toothbrushes in the city of Manaus.

Additional reporting by agencies