Matthew Charles, a rehabilitated felon whose mistaken release and reincarceration drew nationwide outcry, will be freed from prison on Thursday at the order of a federal judge. Charles, who already served 20 years in prison, received a sentence reduction under the First Step Act, a criminal justice reform bill that President Donald Trump signed on Dec. 21.

In 1996, a jury convicted Charles on charges related to the distribution of crack cocaine and unlawful possession of firearms. He received a 35-year-sentence under a law that harshly penalized crack, treating one gram of the drug like 100 grams of powder cocaine. In 2010, Congress amended the law to reduce this disparity, and the revised sentencing guidelines applied retroactively to some prisoners. Charles petitioned for a sentence reduction, citing both the new law and his own spotless record behind bars, where he taught GED classes, pursued college coursework, helped inmates with legal appeals, and completed 30 Bible correspondence courses. In 2016, U.S. District Judge Kevin Sharp granted the request, ordering Charles’ release.

But Sharp made a mistake. The law did not permit early release for offenders who, like Charles, were deemed “career criminals.” So prosecutors appealed Sharp’s decision, and in December 2016, the 6th U.S. Circuit Court of Appeals ordered Charles back to prison. By that point, the ex-offender had fully re-entered society: He spent every Saturday morning volunteering at a food pantry in North Nashville, Tennessee, mentored young men on probation or parole, reconnected with his children and grandchildren, obtained a job, and began a relationship. The 6th Circuit even acknowledged that Charles had amassed a record “not only of rehabilitation but of ‘good works,’ ” and suggested that Trump should consider commuting his sentence.

But Trump granted no clemency, and in 2018—after living nearly two years as a free man—Charles reported back to prison to serve the remaining decade of his sentence. The government transferred him to a medium-security facility in South Carolina, hours away from his friends and family. His case sparked outrage across the political spectrum and helped create momentum for the First Step Act, which made the 2010 reforms fully retroactive. That meant even “career criminals” like Charles sentenced under the old, stringent guidelines could petition for early release. On Dec. 27, public defenders asked a federal court to release Charles for time served, and federal prosecutors did not object. And on Thursday, U.S. District Judge Aleta Arthur Trauger ordered Charles’ immediate release.

Shon Hopwood, one of Charles’ attorneys and a fierce advocate for the First Step Act, was overjoyed by the news. “Today, Matthew Charles’ sentencing judge righted a great injustice,” Hopwood told me. “Matthew earned a second chance at a new life and today he received it.” About 2,600 other federal inmates serving crack convictions should soon be freed under the new law, as well. The First Step Act won’t single-handedly resolve America’s mass incarceration crisis. But for people like Matthew Charles, it’s nothing short of a miracle.