Updated

A man convicted of robbery in 2000 but never sent to prison until last year because of a clerical mistake walked free Monday after a judge lauded his "exemplary" behavior during 13 years of freedom.

Cornealious "Mike" Anderson dabbed tears from his eyes as the judge announced his decision during a hearing that lasted just 10 minutes. Anderson left the courtroom with his wife and 3-year-old daughter on one arm and his mom on the other.

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. He told The Associated Press last month that he waited, and even asked about going to prison, but the order never came.

In the years since his conviction, Anderson started his own construction-related businesses, married and had children. He also coached youth football and volunteered at his church in Webster Groves, Missouri.

Judge Terry Lynn Brown cited Anderson's behavior before his arrest last year. "You've been a good father. 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."

As Brown announced the ruling, about 10 of Anderson's relatives broke out in sobs and cried.

Before being driven away to a freedom celebration, Anderson told reporters he was "very happy. My faith has always been in God. I'm just so thankful. Thank God for everything."

Missouri 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."

The judge said rather than Anderson being granted parole, he would get credit for the 4,794 days between when he was convicted and when he was arrested last year.

Anderson's plight drew international headlines last month. An online petition on change.org includes more than 35,000 signatures urging the state to set him free. Even Koster seemed inclined to find a solution to resolve what he called a "difficult situation."

Anderson, 37, had never been convicted of a serious crime before the robbery. He was sentenced to 13 years in prison for the holdup, then told to wait for orders that would specify when and where he was to report to prison. But the orders never came. Anderson suspected that his case had been overlooked and asked his former attorney what to do.

"Day by day, month by month, year by year, time passed, and they never picked me up," he said in the interview with AP.

A court filing by the attorney general's office said the mistake happened with a trial court clerk failed to inform the Missouri Supreme Court that Anderson was free on bond after his initial conviction.

So Anderson went about his life, never trying to conceal his whereabouts or identity. He married, divorced, married again. He raised three children of his own and a stepchild, owned and operated three construction businesses. He coached his son's youth football team in Webster Groves, and he ran the video operation at his church.

In July, Anderson's sentence was supposed to end. It was then that someone at the Missouri Department of Corrections realized he had never been put behind bars. Eight U.S. marshals arrived one morning at his home in a middle-class neighborhood and took him away. He was in prison by noon that day, and has remained behind bars ever since.

Koster said last month that his goal was to suggest a way for the court to balance the seriousness of Anderson's crime with the clerical error made by the justice system and Anderson's conduct since the robbery.

"All three factors deserve recognition in resolving this difficult situation," Koster said.

Anderson's attorneys filed an appeal in February calling his imprisonment unfair and unjust. They had also asked Gov. Jay Nixon to commute the sentence or grant clemency.