It is the third time Cuba has granted inmates freedom before a papal visit.
Cuba's highest authority says it is releasing 3,522 prisoners include a mix of women, the under-20s, inmates suffering from illness and people whose terms were coming to an end next year.
The government will not release people convicted of serious crimes like murder, child sexual abuse or violations of state security.
The final category is often applied to people considered political prisoners by international human rights groups.
The government says the group includes some foreigners whose home countries have agreed to repatriate them.