HARRISBURG, Pa. (AP) — When Philadelphia’s election board prepared to count ballots last year that were mailed-in without the voter’s handwritten date, Republicans threatened impeachment. Now a GOP Senate candidate wants counties to embrace the same approach.

In a last-ditch bid to close a roughly 900-vote gap with Dr. Mehmet Oz, former hedge fund CEO David McCormick is pressing for undated mail-in ballots to be counted. The Senate Republican primary is still too close to call, now more than two weeks after Pennsylvania’s primary election, and the mail-in vote, which has favored McCormick, could help him.

McCormick insists he simply wants every Republican vote to be counted in a contest that will decide the GOP nominee for one of this year’s most closely watched Senate races. But in calling for undated mail-in ballots to be counted, McCormick is putting the GOP in an uncomfortable spot after the party has spent the better part of two years deriding such votes as “illegal” alongside a broader embrace of former President Donald Trump’s lies about widespread fraud in the 2020 campaign.

“Now it looks like we could be OK for something if it impacts the race in a way you want it to go,” said Mike Barley, a Republican campaign strategist in Pennsylvania who does not have a candidate in the Senate race.

The national and state party are fighting McCormick in state courts, and the U.S. Supreme Court could resolve the matter any day now. In any case, most Republicans believe McCormick is out of luck and will be unable to make up the votes in a recount, regardless of whether undated ballots are counted.

More registered Democrats vote by mail in Pennsylvania than do registered Republicans, possibly as a result of Trump’s baseless smearing of mail-in voting as rife with fraud.

Until now, Republican Party leaders had been solidly unified behind the idea that ballots without a voter’s handwritten date on the envelope must be thrown out.

The law, they reasoned, is clear on that point — even if that handwritten date on a ballot envelope plays no role in determining whether a voter is eligible or whether a ballot is cast on time.

Then, three days after the May 17 primary election, a federal appeals court ruled in a case stemming from a local judicial election last year that throwing out such ballots violates federal civil rights law.

As he tries to find the votes to overtake the Trump-endorsed Oz, McCormick has argued that “every Republican vote should count,” and, in court, his lawyer, Charles Cooper, told a state judge that the object of Pennsylvania’s election law is to let people vote, “not to play games of gotcha with them.”

McCormick’s pursuit has served up a sort of whiplash for Republicans, who had threatened to impeach Philadelphia election officials last year after they moved to count such ballots and accused state judges of stealing a state Senate seat in 2020 when they ruled that the ballots could be counted in that year’s election.

This time around, however, Republicans aren’t blasting judges or threatening to impeach the county election boards that are counting the ballots.

“Not at this point, because it’s still in litigation,” said Republican state Rep. Seth Grove, who chairs the committee that writes election-related legislation.

In court, the Republican National Committee and the state Republican Party have opposed McCormick. The party, however, is not unified in that effort.

For instance, the Butler County Republican Party, which endorsed McCormick, hasn’t taken a side in the fight, said county GOP chair Al Lindsay.

Counties that already counted the undated ballots, without being forced, include Republican counties, both big and small.

Sam DeMarco, the Republican Party chair in heavily populated Allegheny County, said he’s not aware that Republicans have actually changed their mind about the law.

Rather, he has heard griping from Republicans about McCormick “because they think this is what the Democrats would do.”

In any case, it is probably better to get the fight out of the way in a Republican primary, rather than leave it for the general election, he said.

“I just want to get a definitive ruling and, personally I’m happy it’s happening now, in a primary, rather than in November, where the actual seat would be up for grabs,” DeMarco said.

The winner of the GOP primary will face Democratic Lt. Gov. John Fetterman in November.

Barley, the campaign strategist, said the perception that the party has shifted its stance — or that some Republicans have, anyway — sets a dangerous precedent.

“What happens in November if it doesn’t go your way and then you don’t want them counted?” he asked.