Mackenzie Phillips

Former One Day at a Time star Mackenzie Phillips pleaded guilty to one count of felony cocaine possession in a Los Angeles court Friday.

According to People, Phillips also agreed to enter an 18-month drug-deferment program. If Phillips successfully completes the treatment, the case against her will be dismissed. Phillips, who said she's currently enrolled in a live-in treatment center in Louisiana, spoke up in court to express her gratitude.

"I'd like to take this opportunity to thank [law enforcement] for stopping me, and probably saving my life," Phillips said to Judge Keith L. Schwartz.

Phillips, who's had several stints in rehab while battling drugs throughout her career, was arrested Aug. 27 for drug possession at Los Angeles International Airport. She was found carrying what appeared to be heroin and cocaine through airport security.