LAS GARZAS, Panama -- Pope Francis on Friday brought World Youth Day to Panama's juvenile delinquents, celebrating an emotional penitential liturgy inside the country's main youth prison since the inmates couldn't participate in the Catholic Church's big festival of faith outside.

Fulfilling his belief that no one should be separated from God's mercy, Francis also heard the confessions of five inmates at the Las Garzas de Pacora detention centre. At least one of them wept uncontrollably afterward.

"There are no words to describe the freedom I feel in this moment," one of the inmates, Luis Oscar Martinez, told the pope at the start of the service inside barbed wire-ringed facility outside Panama City.

It was an emotional highlight of Francis' four-day trip to Panama and a hands-on demonstration of his belief that prisoners deserve the same dignity as everyone else -- as well as hope.

In his homily, Francis lamented that society tends to label people good and bad, the righteous and the sinners, when it should instead spend its time creating opportunities for them to change.

"This attitude spoils everything, because it erects an invisible wall that makes people think that, if we marginalize, separate and isolate others, all our problems will magically be solved," he said. "When a society or community allows this, and does nothing more than complain and backbite, it enters into a vicious circle of division, blame and condemnation."

Francis has made a tradition of visiting prisoners during his foreign visits, and has long made prison ministry part of his vocation to minister to the most marginal in society. Just last year, Francis changed church teaching on the death penalty, saying it was inadmissible in all cases.

The change was in keeping with his belief that prisoners can always change and deserve chances for rehabilitation so they can re-enter society after serving their terms.

In a sign of that need for inclusion, the Las Garzas inmates wore the same World Youth Day white T-shirts that tens of thousands of pilgrims are sporting around Panama City.

"A society is fruitful when it is able to generate processes of inclusion and integration, of caring and trying to create opportunities and alternatives that can offer new possibilities to the young, to build a future through community, education and employment," Francis said.

Las Garzas houses more than 150 inmates, some of whom are serving time for murder. The facility, considered a model, opened a year after five minors died in a fire at another prison in Panama City in 2011. Nine people including administrators and police were convicted of homicide or negligence in what was the worst tragedy for the country's youth prison system.

At the start of the service, Martinez told Francis of his remorse in becoming estranged from part of his family after he committed an unspecified crime and was sentenced to serve his term at Las Garzas.

"I caused a profound pain in a dear friend and in myself," Martinez, 21, told the pope. He said he wanted to become a refrigeration mechanic when he got out.

"I hope to give this joy to my mother and be in communion with the part of my family that I lost."

In a tangible sign of forgiveness, prison director Emma Alba announced that 11 young offenders -- nine from the Las Garzas facility and another two from Colon province, won conditional supervised freedom after Francis' visit.

Martinez was one of them, she said.

"In this moment, he should be with his family," Alba told reporters hours after the liturgy.

The Vatican spokesman, Alessandro Gisotti, said the visit clearly touched Francis, who wanted to share in the suffering of those who have caused such harm and suffered the consequences.

"I think Pope Francis gave witness to them, and to all of us, that no one is separated from God's mercy, from God's love," Gisotti told reporters.

Francis continued the theme of the suffering church later Friday by presiding over the Way of the Cross procession -- a rite of all World Youth Days that re-enacts Christ's suffering and death on the cross.

The prayers recited during the service reflected issues of particular concern for Central America, including the plight of indigenous peoples, women, the unborn and the church's martyrs, with reference to El Salvador's new saint, Oscar Romero. The prayers also touched on pressing political issues of migration and the upheaval in Venezuela, with a prayer to help those Venezuelans who have "lost their homeland."

"We want to be a church that fosters a culture that welcomes, protects, promotes and integrates, that does not stigmatize, much less indulge in the senseless and irresponsible condemnation of every immigrant as a threat to society," Francis told a crowd that organizers estimated had reached 400,000.

------

Winfield reported from Panama City.