MARTINEZ (CBS SF) — Contra Costa County District Attorney Mark Peterson resigned Wednesday after being charged with 13 felony counts related to his admitted misuse of campaign funds.

The state Attorney General’s Office filed 12 counts of perjury and one count of grand theft against Peterson Wednesday, the same day he was due to be arraigned in Contra Costa County Superior Court to face a civil grand jury accusation that his conduct amounted to “willful or corrupt misconduct in office.”

READ MORE: 49ers All-Pro LT Trent Williams Questionable For NFC Championship

Hours later, Peterson pled no contest to a single count of perjury and resigned from office.

Peterson, who first took office in 2010 and won re-election in 2014, was fined $45,000 by the Fair Political Practices Commission in December 2016 for violating the California Political Reform Act by spending $66,372 on personal expenses.

The money came from Peterson’s political campaign coffers and it was a violation of state law to use it for anything other than campaign expenses.

Peterson spent the money on meals, clothes and other personal expenses, but failed to report any of that spending in his campaign finance disclosure documents filed with the state.

READ MORE: Castro Valley Man Faces Federal Charges In Alleged $1 Million COVID Unemployment Fraud Scheme

Peterson has said he considered the money to be loans and that he was paying the campaign fund back.

He admitted the spending only after he became the target of a state audit.

“I am humbled and embarrassed by my mistakes,” Peterson said in December.

Peterson reached an agreement with the FPPC’s Enforcement Division on the fine and paid back all of the money he took from the campaign account.

MORE NEWS: Crab-Loving Skunk Saved From Entangled Trap In San Francisco

Outside of his legal difficulties, Peterson is also facing mounting political pressure to resign over the difficulties and the Contra Costa County District Attorneys’ Association, which represents the county’s deputy district attorneys, passed a vote of no-confidence leveled at him last month.