Redmond O'Neal

Redmond O'Neal, the son of Ryan O'Neal and the late Farrah Fawcett, has pleaded no contest to bringing heroin to a jail facility and will be transferred from jail into a yearlong rehab program, the Associated Press reports.

News: Redmond O'Neal violates probation, could face prison time

A Los Angeles judge also ordered three years of probation and a six-year suspended state prison sentence for O'Neal on Friday. O'Neal, 24, will not have to serve prison time if he completes the treatment program and three years of probation.

The younger O'Neal has been in custody for five months after violating the terms of his probation for a previous drug charge. He was charged with heroin possession in April after being stopped at a security checkpoint at a detention facility.

News: Ryan O'Neal: Redmond "made a promise" to Farrah to turn life around

O'Neal was briefly released from jail to visit his mother before her June 25 death and to attend her funeral.