Sickening video from a bloody prison battle in Brazil shows twisted gang members playfully kicking the decapitated heads of their rivals on the roof of the jail as 57 people have been killed in the clash.

Six or so inmates were seen horsing around on top of the Altamira Regional Recovery Center in Brazil's northern Pará state.

They appeared to be using human heads as balls for a sickening game of soccer.

The footage emerged hours after a 'rebellion' broke out when gang members from one prison block invaded the prison annex and reportedly set part of it on fire around 7am.

Sixteen of the 57 dead were decapitated in the bloody five-hour-long clash that ended around midday, an official from the Para state government's penitentiary department said.

It was the latest violence to rock the country's overpopulated and deadly prison system.

WARNING: GRAPHIC CONTENT

Sickening video from a bloody prison battle in Brazil shows twisted gang members playfully kicking the decapitated heads of their rivals on the roof of the jail

Six or so inmates on top of the Altamira Regional Recovery Center in Brazil's northern Pará state appeared to be using human heads as balls for a sickening game of soccer

A man wielding a machete is seen with his foot over one of the recently-decapitated heads

A gang member proudly showed off a pile of five heads surrounded by a pool of blood

A 'rebellion' broke out at the prison when gang members from one block invaded the prison annex and set part of it on fire around 7am Monday. Video shows the building up in flames

Local reports said gang members from Block A stormed Block B, which was occupied by a rival group, locked a room and set it on fire, causing many prisoners to die of asphyxiation, as per the Oservador.

Military police were called to the scene and negotiated with the inmates who had barricaded themselves in a cell block.

Brazilian media have reported that two prison officers were taken hostage in the conflict but were eventually freed following negotiations with civil police and the state's Prosecutor's Office.

Reported video of the conflict showed smoke billowing from one prison building.

The riot broke out on Monday at 7am local time at Altamira Regional Recovery Center in the northern state of Pará and lasted for five bloody hours

Local reports said gang members from Block A stormed Block B, which was occupied by a rival group, locked a room and set it on fire, causing many prisoners to die of asphyxiation. Smoke pictured rising from the Brazilian prison on Monday

Two correctional officers were held hostage during the riot and later released. Sixteen of the dead were found brutally beheaded

The Altamira prison has a capacity of 200 inmates but was occupied by 311 prisoners

The riot comes exactly two months after 55 people were confirmed dead in a riot in the northern Amazonas state of Brazil in May

The Altamira prison has a capacity of 200 inmates but was occupied by 311 prisoners, according to Brazilian News outlet G1.

Brazilian authorities have not named the two rival gangs involved in the attacks.

A fight between crime organizations would have motivated the rebellion, according to Brazilian newspaper O Globo.

However, violence in Brazilian prisons, particularly among gangs, is not uncommon.

The riot comes exactly two months after 55 people were confirmed dead in a riot in the northern Amazonas state of Brazil in May.

Monday's battle marked the second largest prison massacre in 2019.