Actor Brad Renfro pleaded guilty Thursday to attempted possession of heroin in a case stemming from his December arrest during a sting in Los Angeles' Skid Row area.

Renfro was given three years probation and must enter a drug rehabilitation program under a law that allows people convicted of nonviolent drug possession to receive treatment instead of jail time.

Renfro faces up to 18 months in prison if he violates the terms of his sentence, said Superior Court Judge David Horwitz.

The actor remains free on $10,000 bail pending a court appearance March 6 to begin the rehab program.

Renfro, 23, voluntarily entered a residential drug rehabilitation program after his Dec. 22 arrest, said his attorney Richard Kaplan. The actor is no longer in the live-in program, Kaplan said.

Renfro's movies include "Ghost World," "The Jacket" and, as a child in 1994, "The Client."