Prison officials have begun transferring the ringleaders behind a deadly fight at Altamira jail in north-eastern Brazil.
Fifty-eight inmates were killed when members of a criminal gang known as Comando Classe A (CCA) attacked rivals from the Comando Vermelho (Red Command) gang.
The number of dead rose from 57 to 58 after a further body was found among rubble on Tuesday.
Sixteen of the dead were decapitated, the others died from asphyxiation after a fire was started in one of the cells.
Smoke quickly spread through the building and could be seen billowing from outside the prison.
Justice Minister Sergio Moro ordered that the gang members behind the deadly fight be transferred to other jails. In total, 46 inmates are being moved.
Those considered most dangerous were taken to federal prisons, which are deemed to have better security than state jails.
An official report published on Monday said the number of guards at Altamira jail - only 33 - had not been enough to guarantee safety at the prison.
But on Tuesday, armoured guards were on hand to escort forensic experts into the prison.
Meanwhile, there were chaotic scenes outside the Legal Medical Institute where relatives of those killed were waiting for hours to be called to identify the bodies.
More than one relative fainted after having to identify the mutilated body of a loved one.
A worker at the coroner's office asked the local firefighters to provide the waiting relatives with water, food and medical help.
Forensic officials said 15 bodies were released for burial on Tuesday.
All pictures subject to copyright.