The prisoners could not escape the blaze in what appeared to be a settling of scores between rival gangs in the lockup in Ponte Nova in the south-central Brazilian state of Minas Gerais, said police Lt. Andrea Amara Lopes.
Authorities put out the fire, set before dawn, and rounded up the rest of the inmates while they tried to identify the victims and the perpetrators.
Prison conditions are often criticized as horrendous in Brazil, and gangs frequently rule the lockups. The Ponte Nova prison had capacity for 87 inmates, but 187 were being kept there, according to the Web site of the Estado de Minas newspaper.
The fire came just two days after President Luiz Inacio Lula da Silva announced that Brazil will invest nearly $3.3 billion in new prisons and social programs over the next five years to reduce prison-based violence that often spills outside.
The Justice Ministry plans to construct 160 prisons, give scholarships for police officers and expand social programs in poor areas where crime is rising, such as in Sao Paulo and Rio de Janeiro.
The initiative will also focus on battling corruption and other sources of crime, but will not increase the 575,000 police officers on the streets in Latin America's largest country, or upgrade their equipment.
The goal of the plan is to cut the nation's homicide rate from 29 per 100,000 residents to about 11 per 100,000 residents by 2012.
The new prisons will each be able to house 400 inmates, and educational opportunities will be offered to some of the nation's 420,000 prisoners.
Justice Minister Tarso Genro said the plan would make a positive impact in three to five years.
A powerful prison-based gang last year launched attacks on Sao Paulo's streets and inside prisons that prompted a week of violence. The gang initially targeted police officers — shooting them on the streets, at stations and in their homes — leaving 41 dead.
Nearly 200 people in all were killed, among them prison guards, suspected criminals, jail inmates and bystanders. Another 100 attacks in July left at least six people dead.