Brazil is cutting prison terms for inmates who hit the books behind bars.
A law published Thursday in the official gazette says prisoners will get one day knocked off their sentences for every 12 hours in the classroom.
The law benefits convicted inmates taking elementary school to college level courses, as well as those taking professional trade and re-qualification courses.
Brazil's prisons have allowed classes for years, taught by teachers from the public school system or hired by each state's prison system.
Justice Ministry spokesman Marcos Vinicius said it applies to all inmates regardless of the crime they have committed. The law also cuts prison sentences by one day for every three that inmates work behind bars or in work-release programs.
He said he did not know if similar programs exist elsewhere.A survey conducted by the Justice Ministry in 2010 showed that of the country's nearly 500,000 inmates, just 40,000 were taking classes, most of them at the elementary school level.