DES MOINES, Iowa (AP) — A state court judge has ruled that Democrat Abby Finkenauer cannot appear on the June 7 Iowa primary ballot for U.S. Senate because she didn’t gather enough petition signatures, potentially knocking off the candidate considered by many to be the party’s best chance to unseat Republican U.S. Sen. Charles Grassley.

Judge Scott Beattie, a 2018 appointee of Republican Gov. Kim Reynolds, filed a ruling late Sunday that overturned a decision by a three-member panel of state elected officials. The panel concluded last week that Finkenauer’s campaign staffers had substantially complied with Iowa law that requires candidates to obtain 3,500 names, including at least 100 signatures from at least 19 counties.

Finkenauer plans to appeal the decision and the Iowa Supreme Court scheduled a hearing Wednesday with a promise to rule on the matter by the end of the week to meet deadlines for sending ballots to overseas voters.

Two Republicans challenged Finkenauer’s petition papers, saying signatures from at least two counties did not have the required date accompanying them.

In the past, the panel, which includes the secretary of state, attorney general and state auditor, has found petitions to be in substantial compliance with the law even though signatures were missing or difficult to interpret. Attorney General Tom Miller and Auditor Rob Sand, both Democrats, voted to allow Finkenauer’s petitions citing past precedent for giving deference to campaigns that used the proper forms and made efforts to comply with the law. Secretary of State Paul Pate, a Republican, voted against Finkenauer’s petition.

Kim Schmett and Leanne Pellett, former Republican county elections officials, challenged the signatures and then filed a court appeal of the Iowa Objection Panel’s decision last week.

Beattie concluded that the panel’s legal interpretation was wrong and that the law clearly says each signature should be accompanied by a date. His decision knocked signatures from Allamakee and Cedar counties off of Finkenauer’s nomination petitions, which meant her campaign failed to submit at least 100 signatures from at least 19 counties as required.

Beattie said he took no joy in the decision.

“This court should not be in the position to make a difference in an election, and Ms. Finkenauer and her supporters should have a chance to advance her candidacy. However, this court’s job is to sit as a referee and apply the law without passion or prejudice. It is required to rule without consideration of the politics of the day. Here the court has attempted to fulfill that role,” he said,

Finkenauer accused Beattie of doing the bidding of Grassley and his allies in Washington.

“This misguided, midnight ruling is an outrageous and partisan gift to the Washington Republicans who orchestrated this meritless legal action,” she said. “We are exploring all of our options to fight back hard against this meritless partisan attack, and to ensure that the voices of Iowans will be heard at the ballot box.”

Finkenauer said her petitions had more than 5,000 signatures and she’s confident she has met the requirements to be on the ballot.

Beattie promised last week he would file a decision by midnight Sunday to give either side time to appeal to the Iowa Supreme Court. He filed the decision at 10:49 p.m. Sunday. Pate has said he must know whether Finkenauer qualifies for the ballot by Friday to give him time to have ballots printed and sent to overseas voters who must get their ballots by April 23 to comply with the law.

Finkenauer, who served one term in the U.S. House from 2019-2021, seeks to be on the ballot with Democrats Mike Franken, a retired Navy admiral, and Glenn Hurst, a doctor and Minden City Council member. The primary winner will face Grassley, who is seeking an eighth term in the Senate.

Federal fundraising data and statewide polling indicate that Grassley, who turns 89 in September, is well positioned to retain the seat he has held since 1981 for another six years.

Grassley has raised more than $4.7 million, Finkenauer about $1.9 million and Franken $1.8 million. Hurst raised just over $66,000. Republican state Sen. Jim Carlin, who will be on the Republican primary ballot opposite Grassley, raised $282,151.

The Des Moines Register/Medicom Poll published in November gave Grassley a lead of 18 percentage points over Finkenauer.

Alan R. Ostergren, the attorney for Schmett and Pellett, said the judge’s decision is a victory for the rule of law.

“Iowans expect candidates to follow state law and to follow the same rules as the hundreds of other candidates who successfully qualified to be on the ballot,” he said in a statement. “Anyone who has ever been involved in a political campaign knows that you can easily avoid problems by turning in more than the bare minimum number of signatures. Abby Finkenauer didn’t do this for some reason and got caught short.”