updated 08/24/2011 AT 2:55 PM ET
•originally published 08/24/2011 AT 3:15 PM ET
Redmond O’Neal narrowly dodged a prison sentence Wednesday after a judge agreed he needed more treatment.
O’Neal, 26, pleaded no contest to felony gun and heroin possession in a Los Angeles courtroom and was sentenced to one-year inpatient treatment. The troubled son of Ryan O’Neal and the late Farrah Fawcett will remain on probation for the next five years.
In a joint statement, O’Neal’s attorneys Richard Pintal and Michael Brewer told PEOPLE: “We are pleased and grateful that the judge gave Redmond further treatment rather than incarceration. His history of addiction warrants this approach.”
Ryan O’Neal attended the hearing Wednesday, but did not address the court.