RICHMOND — A judge on Friday threw out three misdemeanor charges of improper conduct at a polling place that had been brought against state Sen. Joseph D. Morrissey (D-Richmond).

The dismissals came during a brief hearing in General District Court before retired Judge Robert H. Downer Jr., who was brought onto the case last month after questions were raised about an appearance of a conflict of interest involving the initial judge who arraigned Morrissey.

Morrissey was charged in December after allegedly interfering at a Richmond polling place during the 2019 election in which he won his Senate seat. He gave a box of doughnuts to election workers and posed for photos with the workers as people waited to vote.

But Morrissey argued that state law allows elected officials to enter polling places for up to 10 minutes and that doing so is common practice. He also pointed out that he had no Republican opponent for the seat and beat an independent candidate by nearly 2 to 1.

He had lined up affidavits from a host of voters saying that there was nothing improper about what he calls “Donutgate.”

In a statement after the hearing, Morrissey faulted state Attorney General Mark R. Herring (D) for allowing the case to go forward. Herring authorized the investigation of a sitting lawmaker, though he did not initiate the case. That was done by the Richmond commonwealth’s attorney, who later recused herself, and the charges were handled by a prosecutor from New Kent County.

Herring “thought he could score political points at my expense,” Morrissey said. “His behavior was disgraceful and he will pay the price at the polls this summer.”

Herring is running for a third term, but Morrissey had previously endorsed Herring’s rival — Del. Jerrauld C. “Jay” Jones (D-Norfolk) — for the nomination.

“The Office of Attorney General had no involvement in the decision to request an investigation or a special prosecutor, the investigation itself, or the charging decision, and has no involvement in the case,” Herring spokeswoman Charlotte Gomer said via email.

The case had highlighted the sometimes-cozy relationships between Virginia lawmakers and judges. Virginia is one of only two states — the other is South Carolina — where judges are appointed by the legislature.

Chief District Court Judge David M. Hicks initially agreed to handle Morrissey’s case even though he was up for another six-year term on the bench and Morrissey is part of the local delegation that would determine whether to reappoint him.

While the criminal case was pending, Morrissey gave a glowing endorsement of Hicks to a General Assembly committee considering judicial appointments.

After The Washington Post wrote about the situation, Hicks recused himself and asked that a retired judge take the case instead.