Shocking video has emerged of prisoners in Brazil playing soccer with the decapitated heads of rivals in the aftermath of a massive riot that killed at least 57 inmates, according to a report.

The chilling footage appears to show the barbaric prisoners kicking around the severed heads at the Altamira Regional Recovery Center in the northern state of Para, according to The Sun of the UK.

Officials said 16 prisoners were decapitated in the free-for-all between the Rio de Janeiro-based Comando Vermelho and a local criminal group known as Comando Classe A.

“Leaders of the (Comando Classe A) set fire to a cell belonging to one of the prison’s pavilions, where members of the (Comando Vermelho) were located,” a statement read.

State prisons head Jarbas Vasconcelos said the blaze had spread rapidly with prisoners held in old container units that had been adapted for the lockup while another building is under construction.

The fire prevented police from entering the building for several hours, he said.

Two prison staff members who were held hostage were eventually released unharmed.

“It was a targeted attack. The aim was to show that it was a settling of accounts between the two groups, not a protest or rebellion against the prison system,” Vasconcelos said.

Authorities found makeshift knives after the riot, but no firearms. Officials said 46 prisoners will be transferred to other prisons, 10 of them to stricter ones.

President Jair Bolsonaro was elected on the promise of curbing rampant violence in Brazil, including in the country’s often overcrowded, out-of-control prisons.

With Post wires