It's one of the most ironic legal twists in a long time -- TMZ has learned the lawyer who cut the very sweet plea deal for Charlie Sheen also represents Brooke Mueller, the alleged victim in the case and the woman Charlie is almost certainly divorcing.
We've learned ... early on, Charlie's local lawyer tried in vain to cut a plea deal. Then Yale Galanter, who has deep roots in Aspen, was asked by Charlie's people back in March if he could help.
Galanter contacted Pitkin County D.A. Marty Beeson, who we're told initially would only accept a felony plea. Galanter then started wheeling and dealing, even though he was attorney of record for Beeson's star witness.
It took weeks, but Beeson ultimately agreed to a deal that allowed Charlie to plead no contest to misdemeanor assault and serve around two weeks in jail.
After Beeson agreed to the plea, Galanter went on the hunt to find a place that would meet the criteria for work release. We're told Galanter worked with the Sheriff and honchos at Theatre Aspen for more than a week, and sealed the deal late Friday.