VIDEO: People watch pope visiting prison

Pope Francis visited Palmasola high security prison on Friday as he wrapped up his visit to Bolivia with a message of hope and solidarity for those caught up in Bolivia's corruption-plagued criminal justice system.

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.