Ronald Page seemingly had it made when Bank of America unintentionally changed his account status, allowing the 55-year-old man to make unlimited ATM cash overdraft withdrawals.

But ABC News reports that Page, who in reality had only $300 in his checking account, used the accidental loophole to withdraw more than $1.5 million—losing it all on gambling.

And even worse for Page, the U.S. Attorney's Office in Detroit says he is now facing 15 months in prison after pleading guilty to charges of theft of bank funds, $1,543,104 in total between December 1, 2008 and May 31, 2009.

"In this case, the bank's glitch allowed the defendant to lose a significant amount of money that was not even his in the first place," reads the U.S. Attorney's sentencing memorandum, obtained by ABC. "The fact that defendant acted on an impulse does not minimize the seriousness of his conduct and the need for a custodial sentence."

The day the Bank of America glitch went into effect, Page reportedly withdrew $312,000 from ATMs at the Greektown Casino in Detroit and an additional $51,727 from the MGM Grand Casino. Bank of America placed a hold on his account 17 days later, but he had already withdrawn $1.5 million by that point.

The glitch reportedly occurred because Page originally had a banking account with LaSalle Bank. When Bank of America acquired LaSalle, the glitch somehow occurred while the two banking institutions were transferring account information.

Page, who does not have a prior record, could have faced a steeper sentence but prosecutors said his crime was a "lapse of judgment" and placed blame with Bank of America for allowing the withdrawals to take place.

In addition to the recommended 15-month sentence and order to repay the funds, the U.S. Attorney's Office has suggested that Page be prohibited from gambling in any capacity.

"If his gambling addiction is not addressed, he is very likely to cause further financial hardship to himself and his family," the memorandum reads.