(Bloomberg) -- Bridgewater Associates alum David McCormick and celebrity doctor Mehmet Oz are girding for a long legal fight in their too-close-to-call Pennsylvania Republican Senate primary, with Donald Trump already casting doubts on the outcome. 

The race is expected to end with an automatic recount that threatens to trigger an intraparty battle over who rightfully won, playing out in a state where the 2020 election aftermath went all the way to the Supreme Court.

Oz’s fame helped him secure the endorsement of the former president, who is urging him to unilaterally declare victory. But as the outcome lingers, McCormick’s team has been canvassing his network at Goldman Sachs Group Inc. and beyond to gauge their willingness to contribute to post-election efforts if needed, people familiar with the matter said.

McCormick’s campaign said Chuck Cooper, who handled Florida Senator Rick Scott’s 2018 recount and represented Texas Senator Ted Cruz’s successful campaign finance case before the US Supreme Court, is leading its legal efforts. Oz’s campaign said Megan Sowards Newton, who was general counsel for Jeb Bush’s 2016 presidential campaign and a former general counsel to the National Republican Senatorial Committee, is leading its legal team.

McCormick also hired political operative Mike Roman, a former Trump campaign aide, to call counties to check absentee ballot counts, the people said. In February, Roman was subpoenaed by the US House committee investigating the Jan. 6, 2021 riot at the Capitol.

The race between McCormick and Oz remains uncalled, with Oz holding a 1,100-vote lead with 99% of the vote counted as of 3:30 p.m. on Friday, according to the Associated Press. An automatic recount is expected because it’s triggered under Pennsylvania law if the final margin is within 0.5% of the total vote, and the current margin is 0.1% out of 1.3 million votes cast.

The delayed outcome recalls Trump’s 2020 post-election fight in his loss to President Joe Biden. Pennsylvania was among states at the center of that episode, because of delays in counting ballots. But as segments of the GOP have sought to move on from that election, lest they ruin their chances in November, Trump is bringing it back to the fore. The winner of the primary will face Democratic Lieutenant Governor John Fetterman.

Even before all the votes are counted, Trump is falsely declaring that if McCormick wins, the result must be fraudulent. “Stop FINDING VOTES in PENNSYLVANIA! RIGGED?” Trump said in a post Thursday on his Truth Social platform. He also suggested in a post on Wednesday that Oz “should declare victory” because it “makes it much harder for them to cheat with the ballots that they ‘just happened to find.’” 

The count in the Senate race unfolded slowly in part because state law doesn’t let counties start processing mail-in ballots until 7 a.m. on Election Day, and about 22,000 ballots in Lancaster County had to be manually marked for scanning after a printing error made them unreadable.

The closeness of the race and the efforts to cast doubt on the result could lead to the battle winding its way to the state Supreme Court for final adjudication.

Both Oz and McCormick are leaning on their past lives to help them in Pennsylvania. Oz thanked Trump and conservative talk-show host Sean Hannity for their help as he addressed his primary night event Tuesday. 

“When Sean punches through something, he really punches through it,” Oz said. “He understands exactly how to make a difference, and he’s been doing that this entire campaign -- much of it behind the scenes, giving me advice in late night conversations.”

McCormick has tapped into his Wall Street connections, with more than 60 Goldman executives donating to his campaign.

Both campaigns are expressing confidence as the final Election Day votes and outstanding mail-in and absentee ballots are counted. The Pennsylvania Department of State estimated that as of 11 a.m. on Friday, there were about 8,300 Republican ballots to be counted.

Oz said on Newsmax on Thursday night “this election is ours” and that he wants to start focusing on unifying the Republican Party for the November general election race.

McCormick’s campaign said it still sees a path to victory based on how well McCormick has been performing in the mail-in balloting and his expected strength with military and overseas voters because of his background as a West Point graduate and Gulf War veteran. The campaign said it spent just under $1 million targeting absentee and mail-in voters, including military and overseas voters.

County elections boards began their canvasses on Friday to reconcile the unofficial results of the primary and review provisional ballots, which are cast by voters whose eligibility is questioned for some reason. Military ballots can still be counted if they were received by 5 p.m. on Tuesday.

Acting Secretary of the Commonwealth Leigh Chapman has said she’ll have a good sense about whether there’ll be an automatic recount by Tuesday, the deadline for counties to report their unofficial results.

Under Pennsylvania law, Chapman would order the recount by 5 p.m. on May 26, and counties would have to complete the recount by June 7.

©2022 Bloomberg L.P.