The actor, who spent two months in rehab, is sentenced to four years of probation for his second DUI

Credit: Landov

Chris Klein has owned up to his mistakes.

The actor has served 96 hours behind bars on his own accord for his second drunk-driving arrest and has also completed two months in a live-in rehab facility.

Klein, 31, personally appeared Friday in a Van Nuys, Calif., court where he pleaded no contest to DUI and was sentenced to four years’ probation, fines and an 18-month alcohol education class.

“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 told Judge David B. Gelfound.

The actor faced a mandatory minimum of four days in jail for the repeat offense, and served his time in a private city jail. He must also install an ignition interlock device on his car that will prevent the engine from starting if alcohol is detected on his breath.

His attorney, Blair Berk, told PEOPLE, “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. He deserves enormous credit for stepping up and getting it done.”

The American Pie actor was arrested on June 16 after he was spotted weaving on a Los Angeles freeway.

He was previously arrested in Feb. 2005 for the same offense.