In this July 14, 2010, photo, executive chef Todd Schneider poses in the dining room of the Executive Mansion in Richmond, Va. (Joe Mahoney/Associated Press)

The former chef at the Virginia governor’s mansion pleaded no contest Wednesday to two misdemeanor counts of embezzling food from the historic home, resolving the kitchen dispute that has spun into a political and legal crisis for Gov. Robert F. McDonnell.

Under a deal negotiated with the Norfolk prosecutor, Todd Schneider maintained his innocence but agreed to accept a judge’s guilty finding.

He will serve no jail time but will pay the state $2,300 in restitution for taxpayer-purchased food he was accused of stealing for use in his private catering business, according to the agreement.

The plea provided a remarkably drama-free resolution to a case that had exposed embarrassing details about the Republican governor’s household management, prompted state and federal investigations of McDonnell’s acceptance of gifts from a wealthy political supporter and shaken up the campaign of state Attorney General Ken Cuccinelli II (R) to replace McDonnell as governor.

In court papers, Schneider’s attorneys revealed that it was the chef who first alerted authorities last year to gifts provided by businessman Jonnie R. Williams Sr. to McDonnell and his family, revealing that Williams had paid $15,000 for catering at the 2011 wedding of one of McDonnell’s daughters.

The chef’s plea agreement averts a scheduled mid-October trial, which had threatened to shine a spotlight on McDonnell’s troubles, as well as Cuccinelli’s role in the case, just weeks before the November election.

The Cuccinelli campaign had been dreading that prospect. The case was resolved just as a new poll from Quinnipiac University’s polling institute showed a tight 3-point race between the attorney general and Democrat Terry McAuliffe.

Smiling broadly in front of the courthouse after a Richmond hearing, Schneider told reporters that he was “really thrilled” with the reduced charges.

“Now it’s time for me to move on, love life and love myself and make great food for people,” he said.

Schneider, who said he had trained with Martha Stewart, worked at the mansion from April 2010 until March 2012. He now works as a caterer in Fort Lauderdale, Fla.

The state and federal investigations into McDonnell’s relationship with Williams, the chief executive of dietary supplement company Star Scientific, are ongoing.

A person familiar with the investigation said that prosecutors have requested another meeting with attorneys for the governor and the first lady, but the meeting has not been scheduled and will not take place this week.

Tucker Martin, a spokesman for McDonnell, said the charges against the chef were “serious crimes” and that the governor was “pleased that justice had been served.”

“Mr. Schneider’s prior denials of wrongdoing and his reckless allegations against the governor’s office and the McDonnell family have been completely discredited by today’s criminal convictions,” said Jason Miyares, a spokesman for McDonnell’s legal team.

Brian Gottstein, a spokesman for Cuccinelli, who had pursued four felony charges against Schneider in March before withdrawing from the case because of conflicts of interest, said the plea vindicated Cuccinelli’s decision to press charges.

Steve Benjamin and Betty Layne DesPortes, Schneider’s attorneys, had argued unsuccessfully that the charges should be dismissed altogether because Cuccinelli’s conflicts were so serious that he was unable to act as neutral prosecutor.

Cuccinelli had accepted $18,000 in gifts from Williams, some of which he disclosed only after McDonnell’s entanglements with the donor became public.

A state investigation found Cuccinelli broke no laws.

Speaking to reporters after the hearing, Benjamin called the agreement an “excellent resolution” for Schneider. But he criticized Cuccinelli for not moving more quickly to recuse his office from the case.

“This prosecution should never have been brought,” Benjamin said. “It should never have been initiated by an attorney general with the pervasive personal, financial and political conflicts of interest that were evident in this case.”

After Cuccinelli’s recusal, a judge appointed Norfolk Commonwealth Attorney Gregory Underwood to prosecute. Underwood declined to comment Wednesday.

As part of the plea, prosecutors and Schneider agreed that in April and May of 2010, mansion staff had told the chef that he could order between $500 and $600 in food on mansion accounts as compensation for events that his catering company had worked at the mansion.

The arrangement was made after the staffers learned from other state employees that they could not reimburse Schneider’s private business because he was also a state employee.

Prosecutors said Schneider continued using food in his private business and charging it to taxpayers from June 2011 to January 2012.

He told investigators last year that he used the food with permission as part of a “bartering agreement” with mansion staffers. But they were prepared to testify at trial that there had been no ongoing agreement allowing the chef to buy food at state expense.

The entire matter has proven costly to the state.

When Cuccinelli withdrew from prosecuting the chef, he said that he did so because his role as an attorney for taxpayers and an attorney for the governor’s office had come into conflict.

As a result, he said, he could not provide counsel to the governor or his staff related to the case or any other that flowed from it, which has included the Williams investigation.

As a result, Cuccinelli appointed two private law firms to provide legal advice to the governor’s office. They serve in addition to a private legal team hired by the governor and his wife and have billed taxpayers $240,000 for their work.

Gottstein, Cuccinelli’s spokesman, said Wednesday that those lawyers would stay on the job despite the resolution of the chef issue.

He noted that issues that arose from the chef’s case are now “present in an ongoing federal investigation.”