"We are all sinners. We all have defects," the pope told the inmates, in an improvised sermon broadcast by Vatican Radio.
By washing their feet, Francis told them, he was willing to do "the work of a slave in order to sow love among us". He urged them to help each other.
Two of the 12 are serving life sentences, and the others are due to be released between 2019 and 2073.
On Thursday evening, in a familiar reprise of an ancient rite, Bishop Robert Morlino of Madison, Wis., will wash the feet of 12 men, all seminarians — a re-creation of Jesus’ action at the Last Supper when he washed the feet of his disciples and, according to Catholic doctrine, formally instituted the priesthood.
That same evening, thousands of miles away, Pope Francis will also observe the Holy Thursday rite, though not in a cathedral like Morlino but at a center for people with disabilities. There he will wash the feet of a number of residents, all lay people and perhaps some of them women and even non-Christians or nonbelievers.
Francis did something similar last year, shortly after his election, when he stunned church observers by traveling to a juvenile detention center outside Rome and washing the feet of 12 young people, two of them women and two of them Muslims.