Mary Margaret Kreuper, a 79-year-old retired nun from California, has agreed to plead guilty to charges of stealing over $800,000 from a catholic school, New York Daily News reports.

Kreuper, who was the principal at Torrance’s St. James Catholic School for 28 years, admitted in a plea agreement that she stole money from the elementary school from 2008 to 2018, the U.S. Attorney’s Office for the Central District of California said in a statement that was released on Tuesday. Kreuper is being charged with one count of wire fraud and one count of money laundering. The two charges carry a maximum​​​​​​​ sentence of 40 years in federal prison.

The charges were announced following an investigation into the matter by the Torrance Police Department, the FBI, and IRS Criminal Investigation. The investigation into Kreuper, as well as Sister Lana Chang​​​​​​​​​​​​​​, began after an audit was conducted in 2018.

Kreuper admitted to using the money to pay for “large gambling expenses incurred at casinos and certain credit card charges.”

All in all, Kreuper embezzled $835,339 from the school, and was able to do so through her access to the school’s finances.

The former principal “controlled accounts at a credit union, including a savings account for the school and one established to pay the living expenses of the nuns employed by the school,” the U.S. Attorney’s Office said. 

Kreuper was able to go undetected for so long by falsifying​​​​​​​ reports and “lulled St. James School and the Administration into believing that the school’s finances were being properly accounted for and its financial assets properly safeguarded, which, in turn, allowed defendant Kreuper to maintain her access and control of the school’s finances and accounts and, thus, continue operating the fraudulent scheme.”