Four times, the authorities went after the famed Las Vegas sports gambler William T. Walters, and four times the man known as Billy emerged victorious.

But on Friday, Mr. Walters’s luck turned, as a federal jury in Manhattan convicted him on fraud and conspiracy charges in one of the biggest insider trading trials in years.

“To say that I was surprised would be the understatement of my life,” Mr. Walters, who is 70, told reporters as he left the courtroom. “If I would have made a bet I would have lost. I just did lose the biggest bet of my life. Frankly I’m in total shock.”

His lawyer, Barry H. Berke, said he would appeal the verdict.

Mr. Walters, one of the most successful professional sports gamblers in the country, was accused in the latest case against him of using nonpublic information from Thomas C. Davis, a board member of Dean Foods of Dallas, to make more than $40 million from 2008 to 2014 by realizing profits and avoiding losses.