1 of 2
Pool Photo via AP, L'Osservatore Romano
In this pool photo taken on July 9, 2015 and made available on Friday, July 10, 2015, Pope Francis celebrates a Mass at Christ the Redeemer square in Santa Cruz, Bolivia. Francis rallied tens of thousands of flag-waving Bolivians during his first public Mass in Bolivia on Thursday, one of the key days of his South American pilgrimage.

SANTA CRUZ, Bolivia — Pope Francis is wrapping up his pilgrimage to Bolivia with a visit Friday to its notoriously violent and overcrowded Palmasola prison, where inmates have the run of the place, drugs are cheaper than on the street and money buys survival.

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." He has met with prisoners to offer them words of encouragement, and even as pope continued to regularly call a group of Argentine inmates he ministered to when he was archbishop of Buenos Aires.

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. 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.

U.S. businessman Jacob Ostreicher spent 18 months in Palmasola after being arrested for suspected money laundering. Ostreicher, who was released in 2012 when it was revealed that he had been extorted by a ring of prosecutors, judges and government lawyers, said he doubted Francis would see the real Palmasola.

"It's the lifers who control the prison," he said. "The police officers who guard the outside of the prison push you inside the prison and you're on your friggin' own."

Francis is likely to urge the prisoners to not despair, while also acknowledging the wretched conditions they face. It's a message of solidarity with the downtrodden 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 would bring him up close with the reality of the continent's most ostracized and vulnerable.

Inside Palmasola, everything has its price.

"Here corruption rules and he who has money can live well while the rest suffer jammed into huts with dirt floors," said Sirley Maria Vargas, the mother of a 21-year-old inmate accused of homicide. "With money you can have your own room, cleaning service, cable TV, air conditioning and Internet."

Inmates pay $1,000 for the right to a cell and $300 a month for individual cells, she said. Cellphones can be bought, and food and drugs are routinely smuggled in.

Ostreicher said a small bag of cocaine is cheaper inside than an eight-ounce bottle of water.

Bolivia's prison regimen lets inmates roam outside their cells by day. Module I, which has an open regimen, has streets full of men, women and children, domestic animals, stores, restaurants, a gym, a Catholic and evangelical church and workshops. Other prison sections are less hospitable, particularly Modules 3 and 4, which hold the most dangerous inmates. Module 5 houses the infirm, most with tuberculosis.

Francis has gone well beyond his predecessors — and Catholic Church teaching — in saying there is no justification for the death penalty today. He has called solitary confinement a "form of torture" — and said both solitary and the death penalty should be abolished. In a meeting with penal lawyers last year, he denounced prison systems as "out of control" for depriving people of their dignity.

He has also offered words of encouragement to prisoners, twice washing the feet of detainees during Holy Thursday services in Rome and recently lunching with inmates during a visit to Naples, where he met with gay and transgender prisoners.

The church's national coordinator for Francis' visit, the Rev. Aurelio Pesoa, said the pope would receive a wood carving made by inmates, hear a prisoner's testimony and then a speech by its pastoral coordinator, the Rev. Leonardo Da Silva.

Ostreicher said he doubted the pope would be shown the section of the prison where the penniless are "wasting away," forced to sleep in the open and scrounge for food in garbage containers. Rather, he said, he assumed Francis would be shown a Catholic church-run building where destitute prisoners at least get a place to sleep. But the chickens that usually have the run of its alleys may be caged, he said.

Palmasola reflects an all-too-frequent reality in Latin American prisons.

"What's being punished isn't the crime but rather poverty," said Juan Carlos Nunez, an investigator at Jubileo, a Catholic think tank.

Associated Press writers Jacobo Garcia and Carlos Valdez contributed to this report.

Nicole Winfield on Twitter: at www.twitter.com/nwinfield