A high school math teacher says he robbed a suburban Syracuse bank at gunpoint in May to pay his gambling debts.

Mark Gurniak was arrested in May after walking into a Chase Bank in suburban Minoa with a 12-gauge shotgun and stealing $20,000. The 29-year-old was suspended from his position at Cicero-North Syracuse following his arrest.

Gurniak pleaded guilty to second-degree robbery in Onondaga County Court Monday. Judge William Walsh says he'll sentence Gurniak to no more than five years in prison when he returns to court next month.