Phil Mickelson. (Lynne Sladky/AP)

Federal authorities on Thursday charged the former chairman of Dean Foods and a well-known sports bettor, alleging the long-time friends were involved in an insider trading scheme that spanned at least seven years and enriched golfer Philip Mickelson.

William “Billy” Walters made about $32 million from the schemes and was able to avoid losses of about $11 million through his relationship with Thomas Davis, a former member of Dean Foods’ board, according to the indictments filed in the U.S. District Court of Manhattan.

Walters, 69, also used that information to help another long-time friend, Mickelson, according to charges filed by the Securities and Exchange Commission. In 2012, Walters told Mickelson to buy shares of Dean Foods right before it announced plans to spin-off one of its subsidiaries. Mickelson bought shares the next day and about a week later Dean Food’s stock price had jumped 40 percent, according to the complaint. Mickelson made a profit of $931,000, which he has now agreed to return.

“Mickelson had placed bets with Walters prior to the tip, and Mickelson owed Walters money at the time of the Dean Foods trading. Mickelson repaid Walters in September 2012, in part with the proceeds of his trading,” the complaint said.

Walters, who has denied wrongdoing, was arrested in Las Vegas on Wednesday. Davis has pleaded guilty and, his attorney said in a statement, is “happy to be assisting in Department of Justice’s investigation.” He stepped down from Dean’s board last year.

Mickelson was not charged with wrongdoing, but was named as a “relief defendant,” meaning that the SEC wants him to return his profits.

“Phil was an innocent bystander to alleged wrongdoing by others that he was unaware of,” Gregory B. Craig, Mickelson’s attorney, said in a statement.

Mickelson, nicknamed “Lefty” for his distinctive southpaw swing, has been one of the most popular players in golf for the past quarter-century, winning his first PGA Tour event as an amateur in 1991 and earning a total of 51 professional victories worldwide, including five major championships.

Mickelson has earned a reputation as one of the most prodigious gamblers on the PGA Tour, where casual betting on practice rounds is considered standard operating procedure. In one legendary story, he took several hundred dollars off Tiger Woods during a 1998 practice round, then photocopied the $100 bills and taped them up in Woods’s locker, along with a note saying, “Just wanted you to know Benji and his friends are happy in their new home.”

He has also bragged of winning large sums on Super Bowls and World Series through legal bets placed in Las Vegas.

It is through his relationship with Walters, a famed sports bettor, that Mickelson became entangled in the insider trading case. Walters became a Las Vegas fixture in the 1980s, gaining a reputation for big bets that netted him millions.

The insider trading case centers on the relationship between Walters and Davis, a former Dean Foods board member, which started more than 20 years ago at a Southern California golf course, according to the SEC complaint. In 2001, Davis retired from a job at a national investment bank and joined the board of Dean Foods.

“Following his retirement from investment banking, Davis’s financial condition declined, as his spending and gambling habits did not change despite his lower income,” the SEC complaints says. He began passing along inside information to Walters, who he owed money to at various times.

In order to avoid detection, Walters and Davis used prepaid cellular phones and code words, according to the indictment. Walters told Davis to use the phrase “Dallas Cowboys” when referring to Dean Foods, for example. On some days, Walters’ trades accounted for 36 percent of the trading volume in Dean Foods, a staggering amount.

In return for passing along the information, Davis received “business opportunities, investment capital, and approximately $1 million in loans that were, in large measure, never repaid,” the indictment alleged.

The case is just the latest amid a crackdown on insider trading led by U.S. Attorney Preet Bharara. Bharara has secured dozens of convictions and guilty pleas over the last few years, though this case differs because it does not involve a well-known Wall Street figure.

Those efforts had been hobbled recently by a ruling from the U.S. Court of Appeals for the Second Circuit that placed greater limits on insider trading prosecutions, prompting government officials to warn that it could have a chilling effect on such cases.

In a statement, Walters attorney said the “prosecutors’ accusations are based on erroneous assumptions, speculative theories and false finger-pointing.”

“Bill Walters is a true American success story, whose extraordinary accomplishments as a lawful sports gambler have been widely recognized and lauded,” Barry Berke, the attorney, said in a statement.

Whether the case has any lasting implications for Mickelson remains to be seen. His career has coincided with the explosion of prize money in golf and he ranks second (behind Woods) in career earnings on the PGA Tour, with $79,530,748. Even that staggering figure pales in comparison to his off-course earnings through corporate appearances and endorsements – for companies including Rolex, Exxon Mobil, KPMG and Barclays -- which Forbes estimated to be around $40 million annually.

David M. Carter, executive director of the Sports Business Institute and assistant professor of sports business at the Marshall School of Business at USC, said he doubted there would be any lasting damage to Mickelson’s status as a celebrity endorser, if for no other reason than he was not charged with wrongdoing and he made amends through the repayment of money.

“This is not going to be a Martha Stewart type deal,” Carter said, referring to the fallout from the media maven’s conviction related to another insider trading case. “It may very well be a one-day story. It’s when they linger, and there’s a constant drip of media coverage, that it becomes a problem.”