Matthew Charles, a man who was forced to return to prison after a court reversed a judge's ruling that his sentence was unfair, will be released again after the passage of a sweeping federal law that allows courts to shorten unduly harsh prison terms.

U.S. District Judge Aleta Trauger ruled on Thursday that Charles was "entitled to immediate release" under the new law, known as the First Step Act.

Charles, 52, was sentenced to 35 years in prison on charges that he trafficked crack cocaine in 1996. Advocates and experts have argued that sentence was unfair because punishments at the time were much lower for people convicted of dealing powder cocaine.

Over the years, reform laws have aimed to address the disparity by shortening sentences for crack cocaine. Charles' attorneys argued the Fair Sentencing Act, passed in 2010, justified lowering his term.

In 2015, former federal judge Kevin Sharp agreed Charles deserved a shortened sentence. As a result, Charles was released in 2016. He did not re-offend.

But after an appeals court reversed Sharp's ruling, Charles was ordered to serve a full 35 years behind bars. As Charles prepared to return to prison in 2018, his case received national attention in part due to coverage from Nashville Public Radio.

But the new First Step Act, passed into law late in 2018, allowed judges to apply the drug sentencing reforms of the Fair Sentencing Act retroactively. The law cleared the way for Charles' sentence to be reconsidered again.

Federal public defenders representing Charles asked for his sentence to be lowered on Dec. 27, days after the First Step Act was signed by President Donald Trump. Prosecutors responded Wednesday, saying they did not oppose his release because it was allowed under the new law.

"Because Congress has now enacted a new law that does appear to make Charles legally eligible for a reduced sentence, the government does not object to the court exercising its discretion to reduce Charles’s sentence," the federal prosecutors wrote.

Former judge says 'justice prevailed here'

Trauger agreed on Thursday, reducing his sentence to time served. Charles' lawyer said he would be released from prison Thursday evening.

"Justice prevailed here," Sharp, the former federal judge, said in an interview. "It gives you hope that it can happen again."

Sharp, who has become a leading advocate for sentencing reform, said Charles was "a poster child for why this act was needed." The former judge mentioned Charles' case during a meeting with Trump to discuss inequality in the criminal justice system.

The problem, Sharp said, is that Charles' case is not unique. It is similar to many others that do not receive publicity or review.

"There are thousands of them out there," Sharp said. "We can't quit."

Reach Adam Tamburin at 615-726-5986 and atamburin@tennessean.com. Follow him on Twitter @tamburintweets.