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 alleged she siphoned thousands of dollars from her election account to help fuel her gambling addiction.

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

Under the agreement, the state would agree to a suspended sentence if Duran agreed not enter any casinos and undergo treatment for gambling addiction. It also calls for her 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. "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 and elections, Duran would be accused of violating the very laws she was elected to uphold.

Duran had faced calls to step down ever since the state attorney general brought the case against her in late August, and lawmakers took steps to launch impeachment proceedings.

The case also brought new attention to what critics say is a lax campaign finance system in New Mexico in which politicians routinely keep leftover campaign money. Most recently, a former state senator spent $6,500 in campaign funds after he left office and insisted he did nothing wrong.

Lawmakers have also been under pressure to create an ethics commission and write tougher campaign finance laws.

New Mexico Attorney General Hector Balderas, who filed the charges against Duran in August, said he was pleased that she pleaded guilty.

"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, Duran, a 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.

She began her political career as a deputy county clerk in southern New Mexico in 1988 and ran for secretary of state on a platform of eliminating voter fraud.

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

Deputy Secretary of State Mary Quintana will serve as acting secretary of state until Gov. Susana Martinez names a new person to the post. A special election will be held in 2016 to select someone to serve out the remainder of Duran's term, which ends in 2018.

Duran attorney Erlinda Ocampo Johnson and Martinez spokesman Chris Sanchez confirmed Friday that Duran's resignation was effective immediately.

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.

Prosecutors say bank statements show cash withdrawals at casino ATMs around New Mexico.

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.

Republican Party of New Mexico officials said they respected Duran's decision to help restore credibility to the office she held.

"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. Duran was an ardent supporter of voter ID laws that Democrats believe disenfranchise many people at the polls.

"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.

___

Associated Press writer Paul Davenport contributed to this report from Phoenix.

___

Follow Russell Contreras on Twitter at http://twitter.com/russcontreras .