HARRISBURG, Pa. (AP) — A Pennsylvania judge was urged by state lawyers Thursday to order three counties to add some 800 mail-in ballots to their May primary election results, but the local election officials insisted their decisions are firmly rooted in unambiguous state law.

A six-hour hearing in Harrisburg was the latest in a string of recent court proceedings about the rules for absentee and mail-in ballots, a running battle that pits Democrats who embraced mail-in voting under a 2019 law against Republicans who see inconsistent practices and widespread confusion about what is legal.

The acting secretary of state, Leigh Chapman, sued the three counties after they declined to follow her guidance in response to a federal appeals court decision that handwritten dates on a mail-in ballot’s exterior envelope — required by law — are not mandatory.

Jeff Bukowski, lawyer for Berks and Lancaster counties, called the lawsuit “a ginned up case or controversy” that was brought to enforce a policy favored by Chapman, not a complaint by an aggrieved voter or candidate.

He told Commonwealth Court Judge Renee Cohn Jubelirer that local election officials need “some clarity and at least a means by which boards of elections could, hopefully sooner rather than later, get clearer guidance on all the relevant issues.”

The votes, including some from Fayette County, are not expected to change the results of the state’s marquee primary races this year for governor and U.S. Senate, but Jubelirer’s decision could clarify whether inaccurate or missing dates on those envelopes can form the basis for future vote-counting challenges.

Berks County Commissioner Christian Leinbach testified that in his county, which invalidated the most ballots, counting them could change down-ballot races for state party.

“I would not be surprised to understand that it would impact the outcome of some of those races,” said Leinbach, a Republican.

The dates are not needed to show the ballots were mailed in time — county workers separately verify that they were received by the time polls closed on election day — but are required by Pennsylvania election law for the mail-in ballots that are tallied by county election officials.

Lancaster County Commissioner Ray D’Agostino, a Republican, testified that he sees value in the handwritten dates because they “go to the validity and the authenticity of the ballot received” and can raise red flags that prompt further investigation.

The lawsuit was filed this month after officials declined Chapman’s request they reverse decisions to throw out 507 Democratic and 138 Republican ballots in Berks, 45 Democratic and six Republican ballots in Fayette, and 46 Democratic and 38 Republican ballots in Lancaster. Several other counties that had initially voted not to count such ballots did follow Chapman’s guidance and included them in their final tallies.

The state Supreme Court ruled in 2020 that the date mandate did not apply for that fall’s election only, but it was a divided decision that did not set a clear precedent. This year, failed GOP Senate candidate David McCormick sought to have ballots without the date counted and won a court order that counties tally them up separately, but he withdrew his lawsuit and conceded the race.

Chapman’s guidance was issued after a May ruling by the 3rd U.S. Circuit Court of Appeals that handwritten dates on exterior envelopes were not required in a 2021 Lehigh County judicial election.

Pennsylvania Republicans have pushed to limit the use of mail-in voting while Democrats embraced the system during the pandemic. A legal challenge to the 2019 law that greatly expanded mail-in voting in Pennsylvania is currently pending before the state Supreme Court and another was recently filed.

All contents © copyright 2022 Associated Press. All rights reserved