VATICAN CITY (Reuters) - Prisoners from around the world attended a special Mass by Pope Francis on Sunday, hearing him call for society to put more trust in rehabilitation, improved jail conditions and more clemency.

Francis, who has often criticized the effects of unbridled capitalism, also said those who worship the laws of financial markets are themselves prisoners of their own ideologies because markets often punish the weakest members of society.

The Vatican said about 1,000 prisoners took part in the Mass in St. Peters Basilica. Most were from Italian jails and many of these were foreigners. There were also delegations from about 10 other countries, the Vatican said.

They were accompanied by about 3,000 chaplains, guards, ex-prisoners and family members who came to Rome for a day dedicated to prisoners as part of the Catholic Church’s Jubilee year of mercy, which ends later this month.

Two were Mafiosi serving under Italy’s tough special prison regime of solitary confinement for organized crime members, a Vatican official said.

After the Mass, speaking to tens of thousands of people in St Peter’s Square for his traditional Sunday blessing, Francis appealed for prison conditions that respect the human dignity of inmates.

He also called for “the need for a criminal justice system that is not exclusively punitive, but open to the hope and possibility of re-inserting the offender into society.”

Slideshow ( 5 images )

In 2014, a Council of Europe report said Italy had the second-worst prison overcrowding problem in Europe, with 145 detainees per 100 places. Serbia was the worst.

Conditions in Italian jails are believed to have improved since, but some parties want an amnesty for those who committed non-violent crimes in order to further improve conditions.

Francis, who wants a worldwide abolition of the death penalty and opposes life in prison without parole, called on authorities to consider “an act of clemency” towards some prisoners.

Earlier inside the basilica, some prisoners told their stories of crime and repentance and victims spoke of forgiveness.

In his homily, Francis said society should put more stock in rehabilitation.

“Sometimes, a certain hypocrisy leads to people considering you only as wrongdoers, for whom prison is the sole answer. We don’t think about the possibility that people can change their lives; we put little trust in rehabilitation,” he told the prisoners.

“At times, we are locked up within our own prejudices or enslaved to the idols of a false sense of wellbeing. At times, we get stuck in our own ideologies or see the laws of the market as absolute even as they crush other people,” he said.