VATICAN CITY (CNS) — After celebrating Mass with detainees and people who had been in prison, Pope Francis called on governments to mark the end of the Year of Mercy by extending clemency to deserving inmates.

The pope also called for renewed efforts to ensure justice systems not only punish crimes but also work to give prisoners hope for the future.

Civil authorities must work to improve living conditions for those serving time “so that the human dignity of prisoners may be fully respected,” the pope said Nov. 6 during his Sunday Angelus address in St. Peter’s Square.

The pope’s appeal for “an act of clemency toward those imprisoned who are considered eligible to benefit from this measure” came after his celebration of a jubilee Mass for prisoners. Some 1,000 current and former prisoners from 12 countries, as well as priests, religious men and women and laypeople who work in prison ministry, attended the Mass.

Detainees from several prisons in Italy and Spain were given special permission to attend the Mass for the Year of Mercy. Inmates from Italian prisons in Brescia, Busto Arsizio and Palermo served as altar servers, while a choir composed of prisoners and volunteers from the Dozza prison in Bologna provided the music for the celebration.

In his homily, the pope reflected on the Sunday readings, which he said acknowledged “God as the source” of hope.

“Hope is a gift of God. We must ask for it,” he told the inmates and former inmates. “It is placed deep within each human heart in order to shed light on this life, so often troubled and clouded by so many situations that bring sadness and pain.”

The gift of hope, he added, is especially present “whenever someone makes a mistake” but feels the awakening of repentance and forgiveness through God’s mercy.

The jubilee celebration is a time for prisoners and those who have served time to remember that while a price is paid for breaking the law, “hope must not falter,” he said.

“Paying for the wrong we have done is one thing,” the pope said, “but another thing entirely is the ‘breath’ of hope, which cannot be stifled by anyone or anything.”

Those who are behind bars are not the only ones who are imprisoned, the pope warned. People can also fall into “a certain hypocrisy” that judges current and formerly incarcerated “as wrongdoers for whom prison is the sole answer,” he said.

“I want to tell you, every time I visit a prison, I ask myself: ‘Why them and not me?’ We can all make mistakes; all of us. And in one way or another, we have made mistakes,” the pope said, departing from his prepared text.

Hypocrisy can lead Christians to overlook the fact that people can change their lives, he said, but it also makes it impossible for them to see that they, too, are prisoners, locked up within walls of prejudice, ideology and the idols of “a false sense of well-being” and money.

“At such times, we imprison ourselves behind the walls of individualism and self-sufficiency, deprived of the truth that sets us free,” the pope said. “Pointing the finger against someone who has made mistakes cannot become an alibi for concealing our own contradictions.”

Prisoners and formerly incarcerated people should resist being held back by their past mistakes and instead look toward the future with hope, knowing that God’s mercy and forgiveness is greater, he said.

While the past cannot be rewritten, he said, learning from one’s mistakes “can open a new chapter of your lives.”

Through the power of faith, Pope Francis said, repentance by those who have offended and forgiveness by those who have been wronged is possible.

“When violence is met with forgiveness, even the hearts of those who have done wrong can be conquered by the love that triumphs over every form of evil,” he said. “In this way, among the victims and among those who wronged them, God raises up true witnesses and workers of mercy.”