ANTIOCH — California Attorney General agents detained Contra Costa’s embattled top cop Thursday morning, seizing his phone and other items as part of a criminal investigation, court records show.

Contra Costa District Attorney Mark A. Peterson already was facing possible ouster as a result of a grand jury accusation issued against him in May. It relates to Peterson’s admission that he secretly spent more than $66,000 of campaign cash on personal expenses over a five-year period, a violation of California law.

In February 2017, the state attorney general opened a criminal investigation into Peterson’s spending. He is being investigated for possible felony embezzlement, felony perjury and other related offenses, according to a statement in support of a search warrant submitted by a special agent with the attorney general.

Agents on Thursday detained Peterson in Antioch and seized his iPhone, iPad and appointment calendar. The attorney general wanted those items because they are believed to contain “Peterson’s travel schedule, whereabouts and spending habits,” according to a statement of probable cause submitted by the attorney general.

Investigators also searched Peterson’s office on the fourth floor of the Contra Costa District Attorney headquarters in downtown Martinez. No items were seized, according to court records.

Peterson was not arrested during Thursday’s encounter with agents and has not been charged with a crime. In a text message, he confirmed the Attorney General’s Office had “contacted” him.

“We are fully cooperating with their investigation,” Peterson said.

Peterson was first elected district attorney in 2010, and ran unopposed in 2014. He has been caught in a political firestorm since December 2016 when it was revealed that he had illegally spent more than $66,000 from his campaign’s fund on gas, hot meals, movie tickets and clothes, and made cash withdrawals as well. The expenditures were started in 2011, Peterson’s first full year as district attorney, and ended in 2015 when Peterson was selected for an audit by a state tax board.

Peterson admitted to the violations in December, and said he was “humbled and embarrassed” by them. He said he considered the money to be a loan and always intended to fully repay it.

But in documents Peterson sent to oversight agencies — which were signed under penalty of perjury — the number zero was written in under the loan category for all years.

Similarly, Peterson’s financial disclosure statements he submitted to the county for those years have loan sections that were left blank.

In January, the California Fair Political Practices Commission fined Peterson $45,000, saying he had violated the state’s political reform act nine times.

In February, an appellate court issued a ruling that limits what criminal charges prosecutors can file when a public official submits a false document related to his or her financial disclosures.

In May, the Contra Costa Civil Grand Jury served a civil accusation against Peterson, alleging he committed corrupt or willful misconduct in office, and that he should be removed as district attorney. The attorney general was assigned as the prosecuting agency in that matter, which is not criminal in nature and could —- at most — result in Peterson’s ouster. He is scheduled to appear in court in that matter on Wednesday for arraignment.

Peterson, who is running for re-election in 2018 and faces two challengers — a San Jose prosecutor named Patrick Vanier and a senior member of Peterson’s own office, Paul Graves — has said he is looking forward to fighting the grand jury accusation in court, and told a television reporter that he didn’t think the statute cited by the grand jury applies.

After the grand jury accusation was released, prosecutors in Peterson’s office held a no-confidence vote, which passed by a large majority. The attorneys union president, Aron DeFerrari, issued a written statement following news of the AG’s criminal probe.

“Every single day the prosecutors in this office work hard to protect the people of this county and get justice for victims of crime. We have done our jobs in the shadow of Mr. Peterson’s malfeasance for too long,” DeFerrari said. “As line prosecutors, our efforts to bring justice will never relent, but we are ready to close this chapter in our office history.”