A court in Brazil has overturned the conviction of a police colonel jailed for causing the deaths of more than 100 inmates during a prison riot in 1992.
Riots frequently erupted at the overcrowded Carandiru prison
Ubiratan Guimaraes was sentenced to more than 600 years in jail for using excessive force to quell an uprising in Sao Paulo's notorious Carandiru prison.
His lawyers argued their client had followed orders during the riot and that his earlier conviction was flawed.
Human rights groups have denounced the reversal of Mr Guimaraes' conviction.
"It's like giving officers a license to kill," the website of Brazilian newspaper, Folha, quotes a member of Brazil's National Human Rights Movement as saying.
Rights groups have long claimed that the true number of prisoners killed by police in the Carandiru riot is nearer 300.
Mr Guimaraes is the only officer to have been convicted over the deaths.
The 1992 riot caused an international outcry and was featured in the 2004 Brazilian film, Carandiru.
The prison, once South America's largest, was shut down in 2002.
Mr Guimaraes commanded an armed military police unit that stormed the prison to quell the riot.
Survivors of the riot said the police killed prisoners after they had surrendered or while they were trying to hide in their cells.
Mr Guimaraes claimed his men had acted in self-defence, as many of the prisoners were armed. He was convicted over the deaths in 2001.
A Sao Paulo state appeals overturned his conviction on Wednesday after Mr Guimaraes' lawyers argued that he was acting on his superiors' orders.
The lawyers also argued that there had been misinterpretations and errors in the earlier trial.
Prosecutors are now expected to appeal against the quashing of Mr Guimaraes' conviction.