Redmond O'Neal was arrested around 9:30 this morning in Castaic, California -- and here's the rub, he was on jail grounds at the time of his arrest.
According to cops, Redmond had just dropped off two friends at a detention center to visit a jailed buddy, when an officer stopped his car to perform a routine security check in the jail parking lot.
Authorities say when the cop came over to the car, Redmond informed the officer that he was in possession of narcotics.
Redmond was immediately searched and then arrested for possession of a controlled substance and bringing narcotics into a secured jail facility. We're told one of the substances was heroin.
Redmond is still behind bars -- his bail has been set at $25k.