ALBUQUERQUE, N.M. (AP) — New Mexico Secretary of State Dianna Duran pleaded guilty to embezzlement and other charges Friday after abruptly resigning amid a fraud investigation that alleges she siphoned thousands of dollars from her election account and withdrew the money at casinos around the state.

In a packed Santa Fe District courtroom, Duran pleaded guilty to the felony embezzlement charges and four misdemeanors. Sentencing is set for Dec. 14 and Duran can withdraw her guilty pleas if a judge later imposes prison time.

Under the agreement, Duran cannot enter any casinos and must undergo treatment for gambling addiction. It also calls for Duran to pay $14,000 in restitution to campaign donors.

"I now realize some of my choices were not healthy and I will be seeking the appropriate professional help," Duran told reporters outside the courtroom on Friday. "I want it to be completely clear to all New Mexicans that at no time did I ever do anything in my official capacity as secretary of state that would jeopardize the integrity of the office."

Her critics were appalled that as the state official in charge of regulating campaign finance, Duran would be accused of violating the law.

New Mexico Attorney General Hector Balderas, who filed the charges against Duran in August, said he was pleased by the news.

"After today, citizens can be confident that Dianna Duran will no longer have supervisory control of public funds or the reporting process within the Secretary of State's Office," said Balderas, a Democrat.

As secretary of state, the Republican was one of New Mexico's highest-ranking elected officials. She won a second term last year and was the first Republican elected to the post since 1928. Duran, who began her political career as a deputy county clerk in southern New Mexico in 1988, ran on a platform of eliminating voter fraud.

"Fraud happens a lot in this state. That's why we need voter I.D.," Duran told The Associated Press last year during a campaign event that featured former GOP presidential nominee Mitt Romney.

Duran is accused of misusing campaign donations by funneling some $13,000 into personal accounts and filing false campaign finance reports with her own office, which is responsible for enforcing New Mexico's elections and campaign finance laws.

Johnson had argued as late as Wednesday that Balderas had a conflict of interest in filing the allegations against Duran, because the two had sparred in the past.

Balderas strongly disputed that claim.

The case has raised questions about the integrity of New Mexico's campaign finance system, and open government advocates have called for reforms as well as an audit of all campaign finance reports and the creation of a state ethics commission.

State legislators had launched an investigation that could have led to impeachment proceedings.

Republican Party of New Mexico officials said they respected Duran's decision to help restore credibility to the New Mexico Secretary of State's Office.

"Voters rightfully demand that our elected officials be accountable to the law, and our party will continue to advocate for accountability in government," New Mexico GOP Chairman Debbie Maestas said in a statement.

New Mexico Democrats said they hoped Duran's resignation meant the state would have fair elections in 2016.

"We will have a strong Democratic candidate that will take a hard look at the drop in voter participation in New Mexico as well as the other various issues facing the secretary of state's office," Democratic Party of New Mexico Chairwoman Deb Haaland.