Francis' final event before leaving for Paraguay brought him up close to the reality of the continent's most ostracised and vulnerable.
Bolivia has a notoriously corrupt judiciary, with some 1,000 judges and 300 prosecutors under investigation or on trial for corruption.
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.