Updated

A Florida man sentenced to a year in jail turned himself in to authorities after finding out he had been set free because of a computer glitch, MyFoxOrlando reported Friday.

Luis Lopez, 37, had spent the last three months at the Marion County Jail following an arrest in August for his second DUI, driving with a suspended license, hitting two cars and leaving the scene.

He pleaded guilty to all counts and was sentenced this week to a year in jail, followed by a year of probation.

But then something unexpected happened.

"I was released from jail," Lopez told MyFoxOrlando. "For some reason, I just listened to what they had to say."

At first, Lopez questioned the guards, but they assured him they had the paperwork from the courts ordering his release. He followed their orders and walked out of jail.

"I was stunned!" he told MyFoxOrlando.

When he called his public defenders to make sure everything was in order, Lopez learned that there had been a mistake, and immediately decided he would turn himself in before police came to get him.

A broadcast on Fox 35 News showed him knocking on the gate and patiently waiting for a guard to let him check in, while his loved ones watched and cried.

"It would have been better if they had just let him serve his time, instead of releasing him and then taking him away from me again!" Lopez’s girlfriend, Jaimie, told MyFoxOrlando between tears.

A spokeswoman for the Marion County Sheriff's Office and Jail told MyFoxOrlando that the jail is legally obligated to follow any court order they receive regarding an inmate; they received court papers to release Lopez on one year probation.

Just before Lopez headed back to jail, he told MyFoxOrlando he was committed to serving the rest of his term.

"It never should have happened. I just want to do what I have to do now, and get on with my life. That's it," Lopez said.

Click here to read more on the mistaken release from MyFoxOrlando.com.