Francis greeted the inmates one by one, clasping their hands and kissing their children, and then listened intently as a few prisoners told the stories of how they ended up at Palmasola. They spoke of their lives of poverty and the "judicial terrorism" and abuse of power that lets the wealthy bribe their way to freedom while the poor languish in prison.
But he urged the inmates not to despair and to not let their suffering lead to violence.
"Suffering and deprivation can make us selfish of heart and lead to confrontation, but we also have the capacity to make things an opportunity for genuine fraternity," he said.
"Don't be afraid to help one another. The devil is looking for rivalry, division, gangs. Keep working to make progress."
More From This Section
Palmasola is the most notorious of Bolivia's 32 prisons, built to detain some 800 people but housing 5,000, more than four in five still awaiting trial. Inmates have the run of the place, drugs are cheaper than on the street and money buys survival.
Two years ago, 36 people died in a fierce battle between rival gangs using machetes and homemade flamethrowers. One of the victims was a 1-year-old.
Francis has frequently spoken out about the plight of prisoners, denouncing the widespread abuse of pre-trial detention and calling life sentences a "hidden death penalty."
The message of solidarity with Palmasola's prisoners and guards is consistent with his outreach to the downtrodden and marginalized that Francis has championed as pope and in particular on his three-nation South American pilgrimage. In his most important speech of the trip, Francis on Thursday apologized for the sins and crimes of the Catholic Church against the continent's indigenous peoples during the colonial conquest of the Americas.
Francis' final event before leaving for Paraguay brought him up close with the reality of the continent's most ostracized and vulnerable to abuse.