Pope Leo visited one of Spain's largest penitentiaries, becoming the first pope to visit a prison in the country, Reuters reports.
The pope, an advocate for the rights of prisoners, urged the inmates at Brians 1 to make amends for their crimes and commit to living better lives.
Leo said a person's past "does not condemn the future but rather offers the possibility of changing our decisions and choices".
The pope also made a visit to the Benedictine abbey in Montserrat, nestled in a mountain about 60 km (40 miles) from Barcelona, where he urged the monks "to renounce hurtful words, hasty judgment, gossip and slander", including on social media.
Leo also spoke again briefly in the Catalan language, nodding to the northeastern Spanish region's unique identity.
"That a pope, who is such an important person worldwide, talks to people in Catalan gives (me) goosebumps," said Montserrat Cerdeira, 54, outside the abbey.