Receive the latest celebrity updates in your inbox

Klein apologized Friday to a Van Nuys, Calif. judge after having voluntarily served four days in jail and completed two months of rehab, People mag reported.

Top Entertainment Photos

“I apologize for my wrongdoing and I really appreciate that the court gave me the opportunity to prove how seriously I took all of this,” Klein reportedly told Judge David B. Gelfound.

Klein pleaded no contest to DUI and was sentenced to four years’ probation and an 18-month alcohol education class, according to People. He does not have to serve more jail time beyond the 96 hours completed ahead of the sentencing.

Famous Mug Shots: Judge Reinhold

But Klein must install a device in his car to prevent him from driving if alcohol is detected on his breath, People reported.

Police arrested the actor June 16 in Los Angeles after noticing his car weaving across freeway lanes. Klein’s blood alcohol level was three times the legal limit when he was pulled over, police said at the time.

On June 21, Klein checked himself into the Cirque Lodge rehab facility in Utah. A month later, his rep told People the actor had decided to extend his stay.

Klein was convicted of his first DUI in 2005.

“Chris took immediate responsibility for what he did and has used this experience in such a positive way to get help to confront an addiction to alcohol,” Klein’s lawyer, Blair Berk, told People on Friday. “He deserves enormous credit for stepping up and getting it done.”