Cornealious “Mike” Anderson, who used 13 years of accidental freedom building a business and a family, was freed Monday to resume his life after spending nearly a year behind bars when the clerical error was finally caught.

Associate Circuit Judge Terry Lynn Brown needed just a 10-minute hearing before granting Anderson credit for time served for all 4,794 days between his 2000 robbery conviction and his arrest last year.

Anderson, 37, left the courthouse with his wife and 3-year-old daughter on one arm and his mother on the other, tears in all of their eyes.

“Very happy,” Anderson said as he climbed into a sport utility vehicle for the ride home to suburban St. Louis and a planned family celebration. “My faith has always been in God. I’m just so thankful.”

Anderson was 23 when he was sentenced to 13 years in prison for his role in the robbery of a fast-food restaurant’s assistant manager. Freed on bond pending an order to report to prison, he said he waited and even asked when he should report, but the order never came.

In the meantime, he started his own construction-related businesses, married and had children. He also coached youth football and volunteered at his church in Webster Groves, Mo.

At the hearing Monday, Anderson’s attorney, Patrick Megaro, said Anderson remained out of prison through no fault of his own, and in the intervening years, had turned his life around.

“He has been able to accomplish for himself what the criminal justice system does not accomplish in many situations,” Megaro told the judge.

The robbery victim also had said he believed Anderson should remain free.

Brown agreed. He pointed out that Anderson’s crime was serious, but acknowledged that he is a far different man now than he was then.

“You’ve been a good father,” Brown said. “You’ve been a good husband. You’ve been a good taxpaying citizen of the state of Missouri.

“That leads me to believe that you are a good man and a changed man.”

Anderson’s plight drew international headlines last month. An online petition on change.org urging the state to set him free received more than 35,000 signatures.

His release was met with little resistance from the Missouri Attorney General’s Office. Assistant Attorney General Michael Spillane told Brown the court should consider the seriousness of Anderson’s crime, but also Anderson’s behavior over the 13 years of his freedom and the impact that imprisonment would have on his family.

Attorney General Chris Koster said in a statement, “From the outset, I have proposed a solution that balances the seriousness of Mr. Anderson’s crime with the mistake made by the criminal justice system and Mr. Anderson’s lack of a criminal record over the past 13 years. Today’s outcome appears to appropriately balance the facts as we understand them.”

Megaro lauded the state’s understanding of an occurrence that is exceedingly rare.

“This was not an easy case,” Megaro said. “I believe it teaches us that justice can be swift, justice can be harsh, but justice also can be merciful.”