This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

Please enable Javascript to watch this video

A Colorado man who was mistakenly freed from prison, rearrested, then freed again is facing a new hurdle: immigration court.

Rene Lima-Marin's 98-year prison term for armed robbery was cut short by a judge Tuesday, only for him to be detained a day later by Immigration and Customs Enforcement.

ICE told the Denver Post that a federal immigration judge ordered his removal in 2000, and he's in their custody "pending his removal to Cuba."

Mark Fairbairn, a spokesman for the Colorado Department of Corrections, said he was about to be released from a Denver facility Wednesday, but was found to have an immigration hold.

Mistakenly freed

Rene Lima-Marin was sentenced to 98 years for robbing two video stores in 1998.

He was mistakenly released in 2008, but was rearrested in 2014, when authorities realized the error.

In the six years he was free, he found a job, got married, started a family, and purchased a home, said his attorney Kimberly Diego. "His case was unique in that sense," she said. "Not all people who are rehabilitated behave that way."

In a 165-page decision, Arapahoe County District Court Judge Carlos Samour Jr. said he deserved to be free.

"It would be utterly unjust to compel Lima-Marin, at this juncture, to serve the rest of his extremely long sentence," he wrote.

Lima-Marin is an "asset to society" and an "outstanding citizen" who worked with young people and encouraged them to make good decisions, according to the judge's ruling.

The mix-up

The mix-up for the father of two was a result of an error in paperwork that said his sentences were to be served concurrently, instead of consecutively.

Based on the paperwork, an attorney who met with Lima-Marin in prison to discuss an appeal told him his sentence had been reduced to 16 years. The attorney advised him to forgo the appeal and instead wait to be released on parole in 2008.

Lima-Miran's absence from prison wasn't noticed until January 7, 2014, when a former prosecutor searched for his name on the inmate locator website and couldn't find it.

He was arrested that same day to serve the rest of his 98-year sentence, according to the judge's report.

"After its utter lack of care led to Lima-Marin's premature release and prolonged erroneous liberty, in January 2014, the government decided to compensate for its transgressions by swiftly turning back the clock and returning Lima-Marin to prison ... disregarding everything that had transpired between April 2008 and January 2014," Samour said.

Model prisoner

Lima-Marin started his prison term in April 2000, after being found guilty of multiple counts of kidnapping, burglary, aggravated robbery and use of a deadly weapon during commission of a crime.

While a gun was used in the break-ins, no shots were fired and no one was injured, according to the judge.

The judge described him as a model prisoner who completed five years of parole with flying colors.

The government acted with "conscience-shocking" indifference in re-incarcerating him in 2014, the judge said.

"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. Because the court finds that Lima-Marin is being unlawfully detained, he is ordered released. No other remedy will result in justice in this case," the judge said.

Lima-Marin was being held at the Fremont Correctional Facility in Canon City, Colorado. He was scheduled to be released in a few days after an order terminating his sentence had been sent to the Department of Corrections.

In preparation for his release, his name was run through the Criminal Justice Information Service, and it was discovered he was wanted by the Immigration and Customs Enforcement.

CNN has reached out to ICE for comment.

"We just have to wait," his wife, Jasmine Lima-Marin, told CNN affiliate KDVR.

39.739236 -104.990251