lohaninset050313.jpg

It's probably a good thing she's put her old lawyer in charge!

Lindsay Lohan checked into Betty Ford rehab center late Thursday night after re-hiring her former attorney Shawn Chapman Holley.

The legal powerhouse apparently worked all night to secure a court-approved facility for Lilo, who was in danger of having a warrant issued for her arrest if she did not check-in by midnight.

"Lindsay cut a last minute deal with the D.A. to go to Betty Ford. Shawn Holley helped broker the agreement with [Los Angeles] City Attorney [Terry White] late Thursday night," a source told Radar.

The troubled actress narrowly avoided more legal trouble by complying with court orders. Yesterday, rumors swirled that the Mean Girls star had checked into Morningside Recovery Center in Newport Beach, California, and her former lawyer Mark Heller even told the judge that she had already been admitted to the treatment center, which we later learned was not licensed to treat patients.

Miss Lohan previously underwent a rehab stint at the Palm Springs facility in 2010, where she was involved in a scuffle with staffer Dawn Holland that resulted in the employee's firing.

Hopefully this is the end of her trouble making!