(CNN) -- Michael Jackson was a one-man cottage industry for the legal profession.
Michael Jackson shows up for court, late and wearing pajama bottoms, during his 2005 child molestation trial.
Two child-molestation investigations (no convictions), two divorces, myriad civil lawsuits over concerts, special performances and soured business deals, near-bankruptcy and the threatened foreclosure of his Neverland ranch kept teams of lawyers busy.
Jackson's legal stable included the elite of Los Angeles, California, litigators -- Thomas Mesereau Jr., Mark Geragos and the late Johnnie L. Cochran Jr. Legal foes included Gloria Allred, Larry Feldman and Anthony Pellicano, the convicted "wiretapper to the stars."
His legal legacy seems destined to live on. Jackson's death at age 50 is likely to be the subject of a coroner's investigation. Also to be determined is who raises Jackson's three children, whether he left a will and whether anyone will challenge it. Watch how Jackson made and spent his money »
Attorney Allred's thoughts were on the pop music icon's children -- Prince Michael I, Paris and Prince Michael II.
"I am very concerned about the children he leaves behind," she said. "What will happen to them? If the mother relinquished parental rights, then who's to have custody?"
She added that if Jackson left a will, it likely will be challenged in court.
Allred filed the complaint with Child Protective Services that resulted, in part, in the 2004 Santa Barbara County grand jury investigation. Jackson was acquitted in June 2005 of child molestation charges after a 14-week media circus of a trial in Santa Maria, California.
Prosecutors charged the singer with four counts of lewd conduct with a child younger than 14; one count of attempted lewd conduct; four counts of administering alcohol to facilitate child molestation; and one count of conspiracy to commit child abduction, false imprisonment or extortion.
Jackson began the legal battle by giving an impromptu mini-performance for the horde of fans who flocked to his arraignment. CNN legal analyst Jeffrey Toobin was there.
"I was standing about 20 feet away from Jackson on the day of his arraignment in Santa Maria when he danced on the top of his car before an adoring crowd. It was one of the most bizarre moments of my journalism career," Toobin recalled.
Some of the testimony was equally bizarre, as the accusing witness told of being plied with wine -- "Jesus Juice," he said Jackson called it.
Jackson became even more of a curiosity when he wore pajama bottoms to court on the day his accuser took the witness stand. He arrived an hour and 40 minutes late, after the judge threatened to revoke his $3 million bail.
Former child star Macaulay Culkin was among the more than 130 people who testified at the trial. He disputed testimony from earlier witnesses who claimed they saw Jackson behaving inappropriately with him in the early 1990s.
The jury deliberated for 32 hours before clearing Jackson of charges that could have sent him to prison for 20 years.
Jackson's defense attorney in that case, Mesereau, told reporters at the time that "justice was done." He was in court when his former client died Thursday afternoon.
"I'm in an absolute state of shock," Mesereau said. "He was a very gentle, kind soul who wanted to make the universe a better place. I'm honored to have spent the time with him that I did and to have helped preserve his honor, reputation and freedom."
In a February 2003 broadcast of an unflattering television documentary by British journalist Martin Bashir, Jackson was shown on the program holding hands with the boy who accused him of child molestation. He defended as "loving" his practice of letting young boys sleep in his bed.
"He was a great talent but had very poor judgment in the choices he made in his personal life," said Allred, who filed her complaint after watching the documentary.
"His choices led to serious accusations against him. His own words were problematic," she added. "There were significant questions about his personal choices, particularly with young children."
California authorities searched Neverland, Jackson's mansion complete with roller coaster and petting zoo, that November. He was in Las Vegas, Nevada, at the time, and flew back to California on a private jet, accompanied by lawyer Geragos. Even that journey, which was surreptitiously taped, resulted in litigation and an undisclosed financial settlement.
A decade earlier, prosecutors in Los Angeles declined to file charges in their own 13-month child molestation investigation.
A 13-year-old boy complained to social workers that Jackson had molested him over a period of several months in 1993. The boy's father also filed a civil lawsuit, and Jackson's lawyers characterized the allegations as a $20 million extortion attempt. But the case settled out of court, reportedly with Jackson paying millions in damages.
The boy later refused to testify in the Los Angeles case, but was among the witnesses during the 2005 trial in Santa Maria.
Jackson and his legal team were equally well known in the civil courts. He was sued by more than a dozen people over the past decade. Those suing included former managers, financial advisors, lawyers, business partners -- even a porn producer -- over nonpayment or soured deals. He settled most of the lawsuits out of court.
Two marriages -- to Deborah Rowe, his dermatologist's assistant, and Lisa Marie Presley, daughter of the late Elvis Presley -- ended in divorce.
Rowe took him to court over their custody and visitation arrangement, but settled for a reported $8.5 million, giving up her parental rights.
In recent years, Jackson has also narrowly avoided bankruptcy and foreclosure on his Neverland ranch, which also includes an amusement park, complete with Ferris wheel, and a petting zoo.
He sold Neverland last year. He also "amicably" settled a legal claim by a son of the King of Bahrain over a failed $10 million recording venture, according to reports in London.
In the United States, Jackson was still fighting civil claims by a former publicist, a concert promoter and John Landis, the writer an director of his iconic "Thriller" video, according to the Los Angeles Times.