A Pennsylvania court on Thursday ordered counties to include undated mail ballots — those that arrived on time but were rejected solely because they were missing a handwritten date on their outer envelopes — in their vote counts.

The Pennsylvania Commonwealth Court on Thursday ordered counties to include undated mail ballots in their vote counts — a legal victory for GOP Senate candidate David McCormick who had sued to include them in his neck-and-neck primary race against Mehmet Oz.

In a 40-page opinion, President Judge Renée Cohn Jubelirer described the state’s practice of rejecting ballots that arrived without a required handwritten date from the voter on the outer envelope as a potentially unjust restriction of the right to vote.

“The absence of a handwritten date on the exterior envelope could be considered a ‘minor irregularity’ without a compelling reason that justifies the disenfranchisement of otherwise eligible voters,” the judge wrote.

Cohn Jubelirer’s ruling Thursday came in the form of a temporary injunction ordering counties to include the undated mail ballots in their vote tally for the state’s May 17 primaries. But in a nod to the provisional nature of her decision, she instructed counties to submit two sets of election results to the state: one with the undated ballots included and one without. That will allow the state to use the correct total should the ruling be reversed.

If the final ruling mirrors the one she issued Thursday — and it withstands appeal — it would mean potentially thousands of votes are counted in future elections that previously would have been rejected. In the short term, however, it seems unlikely that the fresh votes that McCormick would pick up from among the roughly 800 undated Republican mail ballots in this year’s primary would be enough to push McCormick into the lead. He trails Oz by about 1,000 votes out of more than 1.3 million cast.

At its core, the case revolves around voting rights. Using both the federal Civil Rights Act and the state Constitution’s guarantee that elections “shall be free and equal,” McCormick challenged the idea of throwing out undated ballots, arguing it unfairly disenfranchises otherwise eligible voters over a technicality.

That put McCormick, a Republican, in the company of Democrats and voting-rights advocates who have fought in recent years to have undated ballots counted. Democrats also stand to benefit more in general elections from such a decision, since their voters cast mail ballots in much greater numbers than Republicans.

The state and national Republican Party had opposed McCormick’s attempt to have undated ballots counted, in line with the GOP position over the last two years that state law is clear and voters who do not properly follow that law in casting mail ballots should have those votes rejected.

Cohn Jubelirer was elected to the Commonwealth Court in 2001 as a Republican; she is married to Robert Jubelirer, a longtime Republican state senator who was the powerful head of the Senate for two decades.

The question of whether to count undated mail ballots has been a major front in the fight over how votes are cast since 2020 — and this year has unfolded in multiple places.

In the days ahead, the Oz campaign or the Republican parties could seek to undo Cohn Jubelirer’s ruling in an appeal to the Pennsylvania Supreme Court.

In addition, both campaigns have lobbied elections officials at the county level over undated ballots. And just days before McCormick filed his suit, the U.S. Court of Appeals for the Third Circuit ruled in a similar case that undated mail ballots be counted in a contested 2021 judicial race in Lehigh County, finding the state’s date requirement to be immaterial to determining a voter’s eligibility.

However, on Tuesday, U.S. Supreme Court Justice Samuel A. Alito Jr., who oversees emergency matters in Pennsylvania for the court, issued a temporary delay of that ruling while the wider court considers taking up an appeal. The stay came at the request of one of the candidates in the race with support from Oz’s campaign, which noted the potential implications in his race against McCormick.

In her ruling on the McCormick case Thursday, Cohn Jubelirer’s reasoning largely followed that of the Third Circuit in its earlier decision. She noted that Alito’s delay order had not addressed the appellate court’s findings in detail and that it didn’t, in her view, change the persuasiveness of its findings.

She noted that neither campaign had claimed — “or even hinted” at — any allegations of fraud: “The parties have agreed that this election was free and fair.”

And like the federal appellate judges before her, Cohn Jubelirer balked at the idea of throwing out ballots based on a missing date when it was clear that the date itself isn’t used in any way. Counties accept ballots with the wrong date — such as the voter’s date of birth — and only reject those that have no date at all.

The Third Circuit’s ruling sent elections officials scrambling to figure out what to do with mail ballots and prompted the Department of State last week to ask counties to count them but keep them separate from the rest of the vote.

But since then, Cohn Jubelirer noted, while some counties had done exactly that, others, disagreeing with the state guidance, have refused to open undated ballots and include them in the results.

Before the order was released, one county elections official said Thursday she was waiting for some clarity from the courts before touching the ballots, which were sitting in a safe, unopened. Another said he didn’t want to reject the undated ballots — he just didn’t think the law allowed him to count them unless a court told him to do so.

“This case presents an interesting situation where the status quo is that every county board is making its own determination on what to do with these ballots,” Cohn Jubelirer wrote. “This raises the specter of the unequal treatment of qualified voters in Pennsylvania in that some qualified voters who happened to not date their exterior envelopes are having their vote counted and others are not.”

Throughout her opinion, Cohn Jubelirer described arguments from the Oz campaign and the state and national Republican Parties as unpersuasive.

Their lawyers maintained that ordering the counting of undated ballots would amount to changing voting rules after election day. And regardless, they said, the issue had been settled several times over by state courts, including in 2020 when the Pennsylvania Supreme Court ruled those ballots should be rejected.

But Cohn Jubelirer took pains to distinguish the McCormick case before her this week from the case the state’s high court heard two years ago. Parts of her opinion read as if she was persuading the justices that the different circumstances now should move them to deliver a different outcome should her ruling be appealed.

For example, she noted, no federal court had ruled at that point on the civil rights aspects of the issue. What’s more, the justices in 2020 had not been made aware that ballots with the wrong date were being accepted while counties rejected only those with no date at all.

She noted that it was clear that the justices made their decision at the time “based on the belief that the date written on the exterior envelope was the actual date the ballot was completed.”