It’s a sight that has become more frequent in courthouses around the country: newly exonerated defendants, now free after years or even decades behind bars for crimes they didn’t commit, joyously hugging relatives and attorneys and posing for news cameras.

And it has also become more common to see those same parties back in court—this time as plaintiffs—seeking compensation for the years they’ve lost from the state and local governments that imprisoned them.