A former JPMorgan Chase & Co. broker admitted he stole more than $22 million from customer accounts and used the money to gamble on sporting events, pay his bills, and trade stocks online.

Michael Oppenheim, 49, pleaded guilty Thursday in Manhattan federal court to securities fraud and embezzlement, part of a scam that targeted 10 of his wealthiest clients beginning in 2008.

Under a plea deal, Oppenheim will seek a sentence of eight to 10 years behind bars, but U.S. District Judge Judge Analisa Torres won’t be bound by the recommendation at a sentencing hearing set for Feb. 15. The two charges carry a total maximum term of 50 years.

“Judge, I am ashamed of my conduct,” Oppenheim said. “I wish I would have been caught sooner.” Choking up, he then stopped speaking.

Oppenheim, who lost much of the stolen money on bad bets, has been seeing a psychologist to deal with a gambling addiction that’s affected him “off and on” throughout his life, defense attorney Paul Shechtman said.

‘More Money’

The addiction “is what caused this criminal conduct,” Shechtman said outside court. “The difference between this time and earlier times is that he had access to more money and he wrongfully took it.”

According to prosecutors, the former broker induced clients to withdraw hundreds of thousands or even millions of dollars from their accounts by promising he’d invest the money in low-risk municipal bonds to be held at the bank. Instead, the U.S. said, he used the money to obtain cashier’s checks and deposited them in his own accounts outside the bank, using the money for online trading and personal expenses.

“He lied to his clients about how he would handle their money,” Manhattan U.S. Attorney Preet Bharara said in a statement.

Oppenheim at one point had about 500 clients and almost $90 million under his management, according to the complaint. He was arrested in April at his home in Livingston, New Jersey, shortly after New York-based JPMorgan fired him.