The legal battle over every last vote in Pennsylvania’s too-close-to-call Senate GOP primary has officially begun.

David McCormick’s campaign filed a lawsuit Monday afternoon, citing a federal court order issued on Friday, arguing that election officials must count mail-in and absentee ballots that lack a date on their envelope.

McCormick and his primary opponent, Mehmet Oz, have been arguing about whether or not undelivered ballots should be counted. The battle started late last week, when a three-judge panel on the federal 3rd Circuit Court of Appeals ruled that undated ballots in a county judgeship election in 2021 should be counted.

McCormick’s lawsuit, filed in state court, seeks to compel the state’s chief election official and county election boards to count undated ballots that were returned on time.

As of 6 p.m. Monday, Oz was leading McCormick by less than 1,000 votes, well within the state’s threshold for an automatic recount. In the days following the May 17 primary, Oz and McCormick mobilized an army of lawyers in Pennsylvania and enlisted former members of former President Donald Trump’s 2020 campaign to assist them with behind-the-scenes battles over every vote.

The 3rd Circuit Court of Appeals ruled on Friday that the state’s laws requiring ballots to be dated by the voter were “immaterial” under a federal statute dating back to the Civil Rights Act of 1964, implying that they should have no bearing on whether ballots are accepted or rejected.

However, because the court did not release its full formal opinion, there has been some uncertainty about how — or whether — to apply its findings to other elections besides the 2021 judgeship election.

The order may not be decided by the circuit court. One of the parties in the case, David Ritter, a candidate in that judicial race, asked the court on Monday to stay its judgment, indicating that an appeal to the United States Supreme Court was likely.

McCormick’s campaign sent a letter to Pennsylvania’s 67 counties hours after the judgment was issued, arguing that undated ballots should be counted and requesting a hearing if election boards refused to count them. Oz’s team responded with its own letter to counties, arguing that they should be rejected.

Because Oz is ahead, fewer additional mail-in and absentee ballots are likely to benefit him. McCormick, meanwhile, has been outperforming Oz in those ballots, meaning he could gain if more of those votes are counted.

An Oz campaign aide did not immediately respond to a question about whether the campaign intends to intervene in McCormick’s lawsuit. However, Oz campaign manager Casey Contres stated last week that “the McCormick legal team is following the Democrats’ playbook” and that the campaign “will oppose the McCormick legal team’s request that election boards ignore both Pennsylvania’s Supreme Court and state election law and accept legally rejected ballots.”

According to Grace Griffaton, a Department of State spokesperson, there are approximately 5,400 Republican mail-in and absentee ballots left to count, but “the estimates likely include rejected ballots that have not yet been recorded.” It is unknown how many undated ballots were processed.

In light of the circuit court ruling, some counties had already decided to count undated ballots prior to receiving guidance from the Department of State. According to The Morning Call, Northampton County intends to count 380 undated ballots from both parties.

Other countries are wary of doing so. An attorney for Blair County emailed lawyers representing both McCormick and Oz about the uncertainty surrounding these ballots in an email attached to McCormick’s lawsuit.

In a 4-3 decision issued shortly after the 2020 election, the state Supreme Court ruled that undated mail ballots should be counted at the time. However, the fourth and deciding vote in that decision stated that in future elections, an undated ballot could be disqualified for that reason alone, because voters would have enough notice to completely fill out their ballot envelopes.

Unless the runner-up declines, the race between Oz and McCormick will go to an automatic recount if it comes down to a half-percentage point or less.