On Tuesday a judge ordered the Colorado Department of Corrections to release an inmate 90 years before his sentence was set to end.

Rene Lima-Marin was sentenced to two prison terms totaling 98 years back in 2000 for a pair of robberies he committed when he was a teenager.

The sentences were supposed to be served consecutively, but a court clerk marked them as a single term.

The error allowed for Lima-Marin’s release in 2008.

In the following years Lima-Marin stayed out of trouble, married, and started a family; only to be told in 2014 that the court had realized its mistake and he'd be going back to prison.

Three years of legal battles between Lima-Marin’s family and the courts ensued.

“You forgive, but you don’t forget,” said Rene’s wife Jasmine in an interview with 9NEWS Tuesday.

The legal battle ended Tuesday when Chief Arapahoe County District Judge Carlos Samour Jr. issued a 165-page ruling that ordered for Lima-Marin’s release.

“Requiring Lima-Marin to serve the rest of his prison sentence all these years later would be draconian, would deprive him of substantive due process, and would perpetrate a manifest injustice,” Judge Samour Jr. wrote. “Accordingly, the government is deemed to have waived its jurisdiction to compel him to serve the remainder of his sentence.”

“We actually have something to be happy about after three years,” Jasmine said. “I don't think I've smiled this much. It just feels good to feel like that weight has been lifted and that we can finally move on with our lives.”

Jasmine and her two younger children, ages 10 and 8, have not seen Lima-Marin since a court hearing in December.

When she heard of her husband’s impending release on Tuesday Jasmine said she immediately called Lima-Marin’s mother and then him.

“It was a [very short] conversation,” she said. “I still don’t think it’s hit me. I haven’t even had time to cry.”

In a statement to 9NEWS Lima-Marin’s lawyer, Kimberly Diego, wrote, “We are thrilled that the Court has reached this decision, and allowed for this family to be reunited and for this man to continue the life he led prior to his sudden re incarceration. This is a decision that reaches a just result for a man very deserving of that outcome, restoring faith in a judicial system which can sometimes appear to be broken.”

Lima-Marin’s lawyer says the DOC needs to first receive a formal order from the court, and then check for any outstanding warrants before releasing him.

She says she’s not sure when that will happen but expects it to happen before the end of the week.

As for Jasmine, all she said was, “It’s overwhelming. Every emotion inside of me is overwhelming.”