(CNN) -- A man can do a lot of things in 13 years.
Cornealious "Mike" Anderson was able to open several construction businesses, start a family, coach his son's football team and volunteer at his church.
What he wasn't doing most of that time was serving jail time.
Convicted of taking part in a robbery at a Burger King in St. Charles, Missouri, in 1999, Anderson was given a 13-year sentence. When his appeals ran out in 2002, he was supposed to report to prison, but the call never came.
Corrections officials didn't discover the clerical error until July, when his original sentence would have ended, and they sent U.S. marshals to arrest him.
On Monday, Anderson walked out of the Mississippi County Courthouse a free man, given credit for the 4,794 days between his conviction and when he was arrested last year.
"I walked by faith this whole time, my family and I," Anderson told CNN's "New Day" on Tuesday.
Judge Terry Brown said he didn't see any point in keeping Anderson, 36, in prison.
"I believe continuing to incarcerate you serves no purpose, would be a waste of taxpayer dollars and punish a good man," Brown said at a 10-minute court session.
The tears flowed when the judge granted Anderson's release. Hugs came from his wife and daughter, his mom and his attorney, video from affiliate KMOV showed.
"I was young, and that's something I don't even like to talk about," he said. "That's not who I was. It was just something that should have never happened."
No arrest warrant for him
At the time of the crime, he was 22 years old, and he said he could not fathom spending the next 13 years in prison.
At the time, his attorney warned him that authorities had not arrested him because they thought he was already in jail. The U.S. Marshals Service told the attorney that they couldn't arrest Anderson because there was no arrest warrant for him.
But the mistake will be found, the lawyer said, telling Anderson to be ready to be picked up at any moment.
But the years went by, and that day didn't come for 13 years.
"You know, them pulling me back was motivation, but my main motivation was (that) I turned my life around," Anderson said. "I gave my life to the Lord, and I didn't want to do anything that displeased God."
Attorney General Chris Koster said setting him free was the right thing to do.
"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," he said. Monday's outcome "appears to appropriately balance the facts as we understand them."
Anderson's plight attracted international attention. A Change.org petition lobbied for his release in recent months and attracted more than 35,000 signatures.
For his wife, LaQonna Anderson, it means her husband is back home and their family complete for the first time since July.
"I'm very, very, very happy," she said. "I thank everybody for all their support."
CNN's Jennifer Feldman and Carma Hassan contributed to this report.