Redmond O'Neal, the troubled son of the late Farrah Fawcett and Ryan O'Neal, pleaded no contest to drug and weapons charges on Wednesday and was ordered to spend a year in a live-in rehabilitation program.

O'Neal, 26, was arrested in Los Angeles earlier this month after police found heroin and marijuana in his car following a routine traffic stop for running a red light.

After his arrest, police searched O'Neal's home and discovered a handgun, which he is not allowed to possess because he is still on probation for a 2009 drug conviction. Back then, he was ordered to spend one year in a drug treatment program and given three years probation.

On Wednesday, O'Neal entered pleas of no contest to one count of possessing heroin and one count of possession of a firearm by a felon. In addition to the year in rehab, a judge also sentenced him to five years probation.

It was the latest trouble for O'Neal, who has battled drug dependency in the past and who saw his mother die after a long, public battle with cancer in 2009.