Friday in a New Mexico district court in Santa Fe, former secretary of state Dianna Duran pleaded guilty to felony embezzlement among other charges amid allegations that thousands of dollars were siphoned from her election accounts to pay for gambling debts. As part of plea agreement terms, Duran resigned late Thursday evening. The deal could spare her prison time if is approved by a judge, and can be withdrawn if prison time is imposed later.

Stemming from a confidential tip received in July accusing Duran of misappropriation of campaign funds, in August, Democrat Attorney General Hector Balderas filed a 64-count complaint against Duran accusing her of depositing large amounts of cash and campaign contributions into both personal and campaign accounts she controlled which was spent at casinos throughout the state. Modified to hide the transfers, campaign finance reports had been the source of contention between Duran and Balderas for months, and in February a joint task force was assembled by the two to study the enforcement and reporting of campaign finance laws. Despite pressure calling for her resignation from both sides of the aisle Duran remained in office.

As part of the plea agreement in exchange for five years’ probation Duran admitted to six charges including two felony embezzlement counts and four misdemeanors, is prohibited from entering any casinos, and must enter treatment. Per the agreement, Duran must also pay restitution to campaign donors in the amount of $14,000. Duran was New Mexico’s first Republican secretary of state since 1928, served the public sector since 1979, and rose to the senate in 2010 becoming the state’s second-highest elected official.

According to Chris Sanchez via an AP report, a spokesperson for New Mexico Governor Susana Martinez, until an appointment has been made in the coming weeks, Deputy Secretary of State Mary Quintana will serve as acting secretary of state fulfilling Duran’s term which ends in 2016; at that time a special election will be held for the seat.

A December 14 sentencing date has been scheduled.