Colombo: Prisoners clad in pristine white shirts and sarongs walked out of two dozen prisons in Sri Lanka in the early hours of Wednesday morning around the same time as Pope Francis prepared to declare the country’s first saint.

They were among 612 inmates granted early release to mark the occasion of the pope’s visit to the island nation. Most were serving sentences for minor offences, the prisons department said,  reported wsj.com.

Currently, Sri Lanka has an estimated 17,000 prisoners spread out over 28 jails. Prison overcrowding is a common problem as thousands of prisoners suspected of minor crimes are held behind bars while they await trial, cornered by a complicated and under-resourced legal system. Some are locked up for years because they don’t have money to post bail.

For many inmates, the only real hope of returning to their lives on the outside comes on special occasions when the government announces an early release. Conscious of the many knots in the justice system in Sri Lanka the prison department uses religious occasions and Independence Day on Feb. 4 to ease the burden on the system.

The visit of Pope Francis was one such occasion Wednesday. Prison’s Department spokesman Thushara Upuldeniya outlined how officials pored over long lists to select the 612 inmates who would get their liberty thanks to the pontiff’s historic visit.

Since the pope was invited by then-President Mahinda Rajapaksa in the middle of last year to visit the island nation, government departments were tasked with finding unique ways to mark his stay. Institutions such as the central bank took the tried-and-tested approach of releasing a commemorative coin but the prison’s department aimed for something more showy.

“Some of those we selected are older than 75 years. Their best years have been spent in prison but at least now they’ll get a chance to die with their families,” Upuldeniya said. Most of those released are Buddhist and Upuldeniya acknowledges they may never have even heard of Pope Francis.