CIUDAD JUAREZ, Mexico — Speaking at one of Mexico’s most infamous prisons, Pope Francis said Wednesday that believing crime can be solved by locking up offenders and throwing away the key is a delusion, because it ignores the “structural and cultural” roots of violence and criminal behavior.

“We have already lost many decades thinking and believing that everything will be resolved by isolating, separating, incarcerating, and ridding ourselves of problems, believing that these policies really solve problems,” Francis said at Cereso 3 state prison in Ciudad Juarez.

Cereso prison is among the largest in Mexico, and it’s known derisively as the “University of Crime.”

The prison stop was the first item on a busy itinerary for Francis Wednesday, which features a stop just yards away from the US/Mexico border in order to bless a group including undocumented immigrants on the other side.

Francis has a soft spot for those on the outskirts of society, including the poor, the elderly, and the infirm. As part of that picture, he’s made it a point on all of his trips to visit both a hospital and a prison, including the Curran-Fromhold Correctional Facility in Philadelphia when he was in the United States in September 2015.

His address at the Philadelphia prison was largely personal, avoiding social commentary. In Mexico, the pontiff was more overtly political, issuing a strong criticism of the correctional system.

“We have forgotten to focus on what must truly be our concern,” Francis told the inmates. “People’s lives … those of their families, and those who have suffered because of this cycle of violence.”

Ciudad Juarez is on the US border. His prison visit was broadcast live in 389 prisons throughout Mexico, with an estimated 254,000 inmates watching the feed.

Juarez and El Paso in Texas are divided by the Rio Grande River. Together, they form a metropolitan area of 2.5 million people, the second largest bi-national metropolitan zone on the border after Tijuana-San Antonio.

Francis said he wanted to celebrate the Holy Year of Mercy with the incarcerated, something he’s been asking every diocese to do, encouraging prisons to open their own Holy Doors when possible, or for prisoners to be able to see the entrance to one from their cells.

Mercy, Francis said, is God’s reply to a throwaway culture, “a culture that has stopped supporting life, of a society that has abandoned its children.”

He told the inmates that mercy is a reminder that integration doesn’t begin within the walls of a prison, but before, “outside.”

“Reintegration or rehabilitation begins by creating a system which we could call social health, that is, a society which seeks not to cause sickness, polluting relationships in neighborhoods, schools, town squares, the streets, homes and in the whole of the social spectrum,” Francis said.

The pontiff criticized the prison system, saying that jails are often intended to prevent people from committing crimes, while they should promote a process of rehabilitation that addresses the causes that lead a person to behave in a certain way.

Throughout his Feb. 12-17 visit to Mexico, Francis has repeatedly denounced corruption at a political level, and even within the ranks of the local Church, often faulting politicians for failures of either action or omission, including connivance in violence.

On Tuesday, meeting with a local religious community in Morelia, a stronghold of drug cartels, he asked them not to be “paralyzed by resignation” and to become a part of the fight against organized crime.

On Wednesday, he made a similar appeal to society as a whole, saying that it’s possible to include the poor, infirm, and imprisoned in social life. Their reintegration, Francis said, begins by guaranteeing access to education and a dignified job.

Francis told prisoners that even though the past can’t be taken back — “what is done, is done,” he said — he wanted to celebrated the Year of Mercy with them because there’s always the possibility of moving forward.

“You suffer the pain of failure, you feel the remorse of your actions, and sometimes with great limitations, you seek to remake your lives in the midst of solitude,” he said. “You have known the power of sorrow and sin, and have not forgotten that within your reach is the power of the resurrection, the power of divine mercy which makes all things new.”

“Celebrating the Jubilee of Mercy with you,” Francis told the prisoners, “means learning to open the door to the future, to tomorrow; it means believing that things can change.”