FARRAH FAWCETT & RYAN O’NEAL son snares “get out of jail free” card, goes directly to rehab.

Redmond O’Neal formally pleaded "no contest" this morning to felony possession of heroin and firearms charges, and will be released from jail Wednesday and will enter a one year inpatient rehab treatment program.

 RadarOnline.com reported O'Neal had been in jail since his arrest two weeks ago, because of a prior conviction of heroin possession.

O'Neal's legal team convinced Judge Keith Schwartz this morning that Redmond should go back to rehab, and not jail.

O'Neal also admitted to the probation violation for being arrested while still on felony probation from his heroin possession case two years ago.

Redmond will be released from jail and immediately go to an undisclosed rehab location.

Redmond's dad, Ryan, was present in court this morning for the proceedings, along with Farrah Fawcett's best friend, Alana Stewart.

Stepsister Tatum O'Neal was not present due to "other commitments".