Chilean President Sebastian Pinera has vowed to reform the country's "shameful and inhumane" prisons after a fire left at least 81 inmates dead.
"Chile's prison system is not worthy of a country that treats its people in a civilised way," he said after visiting the San Miguel jail in Santiago.
The fire broke out on Wednesday morning during a fight between rival gangs at the overcrowded jail.
Frantic relatives spent hours outside, desperate for news.
Chilean media broadcast audio and video shot and sent by inmates using banned mobile phones as they called for help and pleaded for the doors to be opened.
Television pictures also showed some prisoners waving their hands through the bars as relatives screamed at security forces to allow them in to help.
Many of the dead were first-time offenders. Among them was Bastian Arragiada, who was serving a 61-day sentence for selling pirated films and was due to be released on 11 January, Chilean news website Emol reported.
Time to act
Speaking after a visit to the jail in the south of the capital, Mr Pinera described the fire as "a hugely painful tragedy" that highlighted the severe deficiencies in the prison system that had dragged on over a long period.
Mr Pinera said the first concern was to help the bereaved families and the prisoners who were injured in the blaze.
"But we must also think how to use this emergency to push forward with improving the conditions in our jails," he added.
"We cannot keep living with a prison system that is absolutely inhumane."
He said the government had launched a project in October to improve the prison system, including building new jails.
Chile has one of the highest per capita number of prisoners in Latin America, according to Amnesty International.
It is believed some 1,900 prisoners were housed in the San Miguel prison, which has a capacity of about 900.
Overcrowding has got worse since last February's earthquake in Chile, which destroyed several prisons.
Prison overcrowding has long been a problem in much of Latin America, a situation that has worsened in those countries facing widespread gang violence and drug-trafficking.
Last month, a fire at a juvenile detention centre in El Salvador, where prisons are filled to three times their capacity, left 16 inmates dead.