VATICAN CITY — Pope Francis held a special Jubilee Mass for prisoners in St. Peter’s Basilica on Sunday, telling them that all people “have made mistakes” and urging them never to give up hope in God’s mercy.

He later urged political leaders across the world to respect the dignity of inmates and offer them amnesty whenever possible.

Wearing green robes and a white skull cap, Francis stood before a congregation made up of some 1,000 prisoners from 12 countries and their families, as well as prison chaplains and volunteers. The event was part of the Vatican’s Holy Year of Mercy, which comes to an end later this month.

“Today we celebrate the Jubilee of Mercy for you and with you, our brothers and sisters who are imprisoned,” he told them. He said while breaking the law involves paying the price, “hope must never falter.”

“Sometimes, a certain hypocrisy leads to people considering you only as wrongdoers, for whom prison is the sole answer,” Francis said in his homily.

“We don’t think about the possibility that people can change their lives. We put little trust in rehabilitation … into society. But in this way we forget that we are all sinners and often, without being aware of it, we too are prisoners.”

Francis has made it a mission of his papacy to encourage greater compassion for the world’s most vulnerable people, including the poor, the sick, the elderly, migrants and prisoners. He has also urged governments to consider granting a Holy Year amnesty to prisoners, to find alternatives to incarceration and, at the very least, to abolish the death penalty.

He repeated this appeal during his weekly Angelus blessing, calling on political authorities “of each country” to improve prison conditions, favor policies that help offenders return to society and offer them clemency whenever possible.

Among those in St. Peter’s Square were Italian Radical Party activists who marched there from Rome prison Regia Coeli to demand amnesty for Italian inmates, citing the poor condition of the country’s prisons.

Before the pope’s arrival in the basilica, several people gave personal testimonies, including those convicted of crimes who had turned their lives around and a mother whose son was murdered. She described her struggle to free herself from hatred by forming relationships with prisoners, including the man who killed her son.

“I learned that we are two sides of the same medal — pain,” said the woman, introduced only by her first name, Elisabetta. Her son’s murderer stood by her side, recalling how when he was given 12 hours of freedom it was Elisabetta who came to spend the hours with him, taking him to her son’s grave, where he placed flowers.

Francis also returned Sunday to a favorite theme, the danger he sees in a blind adherence to capitalism and individualism.

“At times we get stuck in our own ideologies or absolutize the laws of the market even as they crush other people. At such times, we imprison ourselves behind the walls of individualism and self-sufficiency, deprived of the truth that sets us free,” he said.

Next to the altar was a statue of St. Mary holding baby Jesus with a broken chain in his hands, which Francis pointed to and described as a “chain of slavery and imprisonment” that had been broken.

“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,” he said.

In previous meetings, Francis washed the feet of prisoners ahead of Easter in 2015 and months later offered inmates a private tour of the Vatican gardens and a blessing from the frescoed splendor of the Sistine Chapel.