At least 52 inmates have died — 16 of them decapitated — in a prison riot that broke out on in the northern Brazilian state of Para.

Key points: Rival prison gangs, Comando Classe A and Comando Vermelho, were responsible for the violence

Rival prison gangs, Comando Classe A and Comando Vermelho, were responsible for the violence As Brazil's prison population has grown, so has the influence of the gangs inside

As Brazil's prison population has grown, so has the influence of the gangs inside Brazil's far-right President wants tighter controls on prisons

State authorities said the prison riot began at about 7:00am in the city of Altamira and involved two prison gangs.

Two guards were taken hostage as the groups battled one another, but they were later released.

Prisoners belonging to the Comando Classe A gang set fire to a cell containing inmates who belonged to the Comando Vermelho, or Red Command gang, Para's State Government said in a statement.

The Red Command gang hails from Rio de Janeiro, but has expanded deep into the north and north-east of Brazil as it seeks to diversify its income stream.

The Comando Classe A gang is a relatively small group that is little known outside Para, but its high-profile attack against the powerful Red Command could give it a nationwide reputation.

"It was a targeted act," state prison director Jarbas Vasconcelos said in the statement, adding there was no prior intelligence that suggested an attack would take place.

"The aim was to show that it was a settling of accounts between the two gangs."

Brazil's justice ministry said in a statement it was working with Para state authorities to identify those behind the latest attack, adding it had opened up space in Brazil's federal prison system where those gang leaders would be sent.

As Brazil's incarcerated population has surged eight-fold over three decades to about 750,000 inmates — the world's third-highest tally — its prison gangs have come to wield vast power that reaches far beyond prison walls.

Brazil's far-right President Jair Bolsonaro has said he wants to impose tighter controls in the country's prisons, as well as build many more of them.

Mr Bolsonaro's ability to curtail violence, however, may be limited as most prisons are controlled at the state level.

In January 2017, nearly 150 prisoners died during three weeks of violence in several Brazilian 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

In February, Justice Minister Sergio Moro unveiled his signature crime-fighting bill, including proposals to toughen prison sentences and isolate gang leaders in maximum-security lockups.

That bill, however, has struggled in Congress, with the Government prioritising its pension reform bill.

Reuters