Golfer Phil Mickelson will repay the profits he made from trading on inside information about Dean Foods Co. that he received from gambler William “Billy” Walters.

The three-time Masters Champion made almost $1 million from the 2012 trading, according to a complaint Thursday by the U.S. Securities and Exchange Commission. The SEC termed him a “relief defendant.” That means Mickelson wasn’t accused of wrongdoing, but was named in the complaint to recover his profits.

Mickelson “feels vindicated,” according to an e-mailed statement from his lawyer, Gregory Craig. “Phil has no desire to benefit from any transaction that the SEC sees as questionable” and has entered an agreement with the regulator to return all the money.

The SEC complaint was released after U.S. prosecutors filed insider-trading charges against Walters and former Dean Foods Chairman Tom C. Davis. Davis pleaded guilty earlier this week. Mickelson wasn’t named in the criminal case.

Mickelson owed Walters money and the Las Vegas gambler called him in July 2012, urging the golfer to trade in Dean Foods stock, according to the SEC complaint. The following day, Mickelson traded in three brokerage accounts he controlled. About a week later, shares jumped 40 percent on announcements of strong quarterly earnings and that Dean Foods would spin off its WhiteWave subsidiary, earning Mickelson about $931,000.

The investigation made headlines in 2014 with news that the government was probing Davis, Walters and Mickelson ahead of billionaire investor Carl Icahn’s $10.2 billion offer in 2011 for Clorox Co. Neither Clorox nor Icahn were mentioned in the SEC or Justice Department documents Thursday. Icahn hasn’t been accused of wrongdoing.

Prosecutors referred in their complaint to someone else who owed a gambling debt to Walters. They spoke by phone and texted in July 2012 before the person bought 240,000 shares in Dean Foods, using three brokerage accounts. The person had never previously traded in the stock, prosecutors said. The timing and description of those trades broadly match the SEC material about Mickelson.