Los Angeles, California (CNN) -- Actress Lindsay Lohan posted a $300,000 bail and was released from jail late Friday night, the Los Angeles Sheriff's Department said.
A judge granted Lohan bail Friday night, overturning a decision earlier in the day that sent the actress to jail until a probation revocation hearing four weeks away, a court spokesman said.
She must be fitted with a SCRAM alcohol-detection bracelet within 24 hours, Los Angeles County Superior Court spokesman Allan Parachini said.
Judge Patricia Schnegg granted Lohan's bail after her lawyer, Shawn Chapman Holley, filed documents just before court closed Friday afternoon, Parachini said.
"I pray to God that Shawn does the right thing and advises her to go right into rehab now, and show the judge she's serious, because in 30 days when she goes back before the judge he can do whatever he wants," Michael Lohan, her father, told CNN.
Judge Eldin Fox ordered the preliminary revocation of Lohan's probation Friday morning based on a probation report saying she tested positive for controlled-substance use.
The probation revocation hearing was set for October 22.
Lohan made fun of her substance abuse troubles in a backstage skit broadcast during the MTV Video Music Awards earlier in September.
She appeared with show host Chelsea Handler, who was wearing an alcohol-detection bracelet like the one Lohan recently wore.
"Wake up, Handler; pull it together," Lohan said as she slammed Handler against a wall. "You're a menace. Do you think anyone will work with a drunk? Take it from me, they don't."
Lohan was arrested twice in 2007 on charges of driving under the influence, and in the second incident, she was charged with cocaine possession.
The first arrest came after Lohan lost control of her Mercedes-Benz convertible and struck a curb in Beverly Hills.
Just two weeks after checking out of a Malibu drug and alcohol rehabilitation facility, she was arrested again in July 2007 after a woman called Santa Monica police, saying Lohan was trying to run her down with a car.
Lohan's acting career, which started at age 10 on a soap opera, took off on the big screen a year later, when she played identical twins in Disney's remake of "The Parent Trap."
CNN's Ninette Sosa and Alan Duke contributed to this report.