HARRISBURG, Pa. (AP) — A state court agreed Thursday night in a ballot-counting lawsuit with the campaign of David McCormick, who is in a neck-and-neck Republican primary contest for the U.S. Senate against celebrity heart surgeon Dr. Mehmet Oz.

In the decision, Commonwealth Court Judge Renee Cohn Jubelirer ordered counties to count the ballots in question, although her decision could be reversed, depending on what the U.S. Supreme Court does in the coming days on a separate case.

Because of the high court’s involvement, Jubelirer ordered counties to keep the undated ballots separate from other ballots and to count them separately.

Get daily news, weather, breaking news and alerts straight to your inbox! Sign up for the abc27 newsletters here.

The ballots in question are roughly 880 mail-in ballots that lack a handwritten date on the envelope.

Jubelirer’s decision comes as the race between McCormick, a former hedge fund CEO, and Oz is in the midst of a statewide recount.

Roughly 900 votes separate McCormick and Oz in the May 17 primary, out of more than 1.3 million ballots cast.

Even if the ballots are counted, many Republicans believe McCormick would be unable to make up the gap with Oz in a recount.

Oz’s campaign, the Republican National Committee and the state Republican Party have opposed McCormick in court.

State law requires a voter to write a date next to their signature on the outside of their mail-in ballot return envelopes. A handwritten date on a ballot envelope plays no role in determining whether a voter is eligible or whether a ballot is cast on time.

McCormick sued in state court to force counties to count the ballots, after the 3rd U.S. Circuit Court of Appeals ruled two weeks ago in a case from a local judicial last year that throwing out an undated ballot violates a voter’s civil rights.

Get the latest news on Pennsylvania Politics and the 2022 Election from Your Local Election Headquarters. Sign up here.

In an emergency appeal, the U.S. Supreme Court temporarily blocked the counting of the ballots.

The Supreme Court’s action — called an administrative stay — freezes the matter until the court can give the case further consideration. There’s no timeline on the high court’s undertaking, and the clock for McCormick is ticking down to next Wednesday, when the recount ends.