HARRISBURG, Pa. (AP) — Pennsylvania’s Republican primary for an open U.S. Senate seat is too close to call and is likely headed for a statewide recount to decide the winner of the contest between heart surgeon-turned-TV celebrity Dr. Mehmet Oz and former hedge fund CEO David McCormick.

A recount would mean that the outcome of the race might not be known until June 8, the deadline for counties to report their results to the state.

Oz, who was endorsed by former President Donald Trump, led McCormick by 1,079 votes, or 0.08 percentage points, out of 1,340,248 ballots counted as of 5 p.m. Friday. The race is close enough to trigger Pennsylvania’s automatic recount law, with the separation between the candidates inside the law’s 0.5% margin. The Associated Press will not declare a winner in the race until the likely recount is complete.

Both campaigns have hired Washington-based lawyers to lead their recount efforts, and both have hired Philadelphia-based campaign strategists who helped lead the operation to observe vote-counting on Election Day for Donald Trump’s presidential campaign in 2020.

The two campaigns combined already had hundreds of lawyers and volunteers fanned out around the presidential battleground state as election workers and election boards toiled through the remaining ballots.

McCormick's lead recount lawyer is Chuck Cooper, a veteran Washington lawyer and a go-to attorney for prominent conservative figures. He represented then-Attorney General Jeff Sessions in special counsel Robert Mueller’s Russia probe and former national security adviser John Bolton in a dispute over the publication of his book. He recently successfully argued a campaign finance case on behalf of Texas Sen. Ted Cruz before the U.S. Supreme Court.

Oz's lead recount lawyer is Megan Newton, who was general counsel for Jeb Bush’s unsuccessful 2016 presidential campaign and the National Republican Senatorial Committee, and has represented Trump's campaign and Mitt Romney’s 2012 presidential campaign.

The winner will face Democratic Lt. Gov. John Fetterman in November's midterm elections in what Democrats see as their best opportunity to pick up a seat in the closely divided Senate.

Fetterman won the Democratic nomination while in the hospital recovering from a stroke four days before the election. The incumbent, Republican Sen. Pat Toomey, is retiring after serving two terms.

Trump’s clout is again on the line, as he looked for a third straight win in Republican Senate primaries after “Hillbilly Elegy” author JD Vance prevailed in Ohio earlier this month and U.S. Rep. Ted Budd easily scored a victory in North Carolina on Tuesday.

County election boards began meeting Friday to sort out problematic or provisional ballots, even as election workers processed the last of the mail-in ballots and election-day ballot tallies from precincts.

A federal appeals court threw a wrench into the counting Friday when it ruled in an unrelated case that mail-in ballots without a legally required date on the return envelope can be counted. McCormick's campaign saw it as a positive development, since McCormick has led Oz in mail-in ballots.

“When every single vote cast in this U.S. Senate election is finally counted, Dave McCormick will win,” his campaign said.

Oz’s campaign did not comment Friday evening.

The state’s 67 counties have until Tuesday’s deadline in state law to certify their results to the state. Then the state’s top election official has until next Thursday to issue a recount order, which is mandatory — unless the losing candidate asks in writing that it not be carried out.

McCormick’s campaign said it has no plans to decline a recount. Oz’s campaign declined to comment.

Counties have until three weeks after the election — June 7 — to finish the recount and another day to report results to the state.

The initial result could change: A recount of a statewide judicial race last November ended up padding the winner’s margin by more than 5,500 votes in a race where more than 2 million ballots were cast.

Before that, there could be a flurry of lawsuits contesting the decisions of certain counties on whether to count ballots that may be difficult to read or bear some kind of irregularity.

As of yet, neither campaign has gone to court, and both candidates have expressed confidence in victory.

The big field of Republican candidates and their super PACs reported spending more than $70 million during the primary campaign.

Oz and McCormick dominated the seven-person GOP field, blanketing the state’s TV screens with political ads for months and spending millions of their own money, before conservative activist Kathy Barnette surged in the campaign’s final days.

The fiery, hard-line pro-Trump alternative blistered both Oz and McCormick as “globalists,” pro-Trump pretenders, carpetbaggers and too wealthy to help regular people. She finished a distant third.

Oz, who is best known as the host of daytime TV’s “The Dr. Oz Show,” had to overcome misgivings among hardline Trump backers about his conservative credentials. Rivals also charged that his dual citizenship with Turkey would compromise his loyalties to the United States. If elected, Oz would be the nation’s first Muslim senator.

McCormick was virtually unknown four months ago and emphasized his credentials as a hometown success story.

He not only had to overcome Trump’s endorsement of Oz, but Trump also attacked McCormick viciously and repeatedly in the final two weeks of the race, calling him a Wall Street liberal, a sellout to China and the candidate of “special interests and globalists and the Washington establishment.”

McCormick got help from a super PAC supporting him that spent $20 million, giving him a massive cash advantage, much of it from Wall Street figures that paid for TV ads to attack Oz.

Both men reported assets of more than $100 million and moved from out of state to run — Oz from a mansion in Cliffside Park, New Jersey, above the Hudson River overlooking Manhattan, and McCormick from Connecticut’s ritzy Gold Coast.

___

Associated Press writer Eric Tucker contributed to this report.

___

Follow Marc Levy on Twitter at https://twitter.com/timelywriter.

___

Follow AP for full coverage of the midterms at https://apnews.com/hub/2022-midterm-elections and on Twitter at https://twitter.com/ap_politics.

Copyright 2022 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.