Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

DES MOINES, Iowa — A former lottery computer programmer who admitted to rigging computers to let him pick winning numbers and cheat four states out of $2.2 million over six years was sentenced as long as 25 years in prison on Tuesday.

"I regret my actions, and I'm sorry for the people I hurt," said Eddie Tipton, 54, the former information technology manager for the Multi-State Lottery Association, the central Iowa organization that provides number-picking computers for lotteries in 33 states, the District of Columbia, Puerto Rico and the U.S. Virgin Islands.

Former lottery security officer Eddie Tipton leaves the Polk County Courthouse in Des Moines, Iowa, in April 2016. Charlie Neibergall / AP

Under Iowa law, Tipton is likely to serve far less than 25 years — probably three to five years, said Iowa Assistant Attorney General Rob Sand, who prosecuted the case. The Iowa Board of Parole will ultimately determine how long he's behind bars.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"I think when you're an insider who abuses your position of trust and privilege, you should expect to see the inside of a jail cell," Sand said.

Tipton's attorney asked state District Judge Brad McCall to give Tipton probation in Iowa, arguing that his client was unfairly being treated far more harshly than other people involved in the scheme.

As part of his plea deal, Tipton also admitted to committing theft by fraud and a computer crime in Wisconsin, where he'll be sentenced Sept. 18. The agreement allows him to serve his Wisconsin sentence — likely to be three to four years — at the same time he serves the Iowa sentence.

Related: Programmer Pleads Guilty to Theft in Lottery Rigging Scandal

Tipton also agreed to repay the $2.2 million to the four states from which the jackpots were paid, but he told McCall that it was unclear how he would get the money. He said he hoped to study the ministry and get a job in that field after prison.

Tipton helped write the computer code behind several U.S. lottery games, including some of its biggest — including Powerball, Mega Millions and Hot Lotto. He worked for the lottery association from 2003 until 2015 and was director of computer information security his last two years there.

Tipton admitted in June to installing code that prompted the computers to produce predictable numbers only on certain days. Tipton said he gave the numbers to play to his brother, Tommy Tipton, a longtime friend, Robert Rhodes, and others and often divided the winnings with them.

Related: Brother of Jackpot Rigger in Massive Lottery Scandal Arrested

Tommy Tipton is serving a 75-day jail sentence in Texas after pleading guilty to a theft charge. Rhodes is expected to get probation when he's sentenced Friday on a computer crime charge.

"Eddie Tipton had the keys to the kingdom and those are the things we changed immediately to make sure any equipment he touched was removed and we continue to look ahead and make sure we have those checks and balances as we proceed," said Terry Rich, chief executive of the Iowa Lottery.