HARRISBURG, Pa. (AP) — The recount began Friday in the too-close Republican primary contest for U.S. Senate in Pennsylvania, with just 900 votes separating famed heart surgeon Dr. Mehmet Oz and former hedge fund CEO David McCormick.

Montour County began the recount on Friday, one of seven counties that said they would start right away. Most of Pennsylvania’s 67 counties said they would begin next week, with a Wednesday deadline to begin.

For less populated counties, the process could take a day. Larger counties say they will need several days.

The recount began as a legal battle all the way to the U.S. Supreme Court and the state Supreme Court could affect the ballots counted.

Counties have until June 7 to complete a recount and another day to report the results to the state.

The initial result of last week’s primary election remained elusive as some counties still had hundreds or thousands of ballots remaining on Friday, including write-in, provisional and mail-in ballots from voters in the foreigner and members of the army.

Oz, which is endorsed by former President Donald Trump, edged out McCormick by just 922 votes, or 0.07 percentage points, out of more than 1.3 million ballots reported by the state Friday afternoon.

The race triggered Pennsylvania’s automatic recount law, with the split between candidates inside the law’s 0.5% margin. The Associated Press will not declare a winner of the race until the recount is complete on June 8.

The winner of the GOP race will face Democratic nominee Lt. Gov. John Fetterman in November’s midterm contest. Democrats see it as their best opportunity to land a narrowly divided Senate seat. Republican Senator Pat Toomey is retiring after two terms.

McCormick’s campaign, meanwhile, has battled in court for votes that could help it close the gap with Oz.

Oz, the Republican National Committee and the state Republican Party oppose McCormick’s quest to force counties to count certain mail-in ballots — those without the voter’s handwritten date on the envelope — that might otherwise be dismissed for a technicality.

Some counties have agreed to count them, while others have not.

A separate case involving these ballots of last November’s election was appealed to the United States Supreme Court on Friday. It came hours after the 3rd U.S. Circuit Court of Appeals denied a motion to stay its earlier ruling that those ballots should be counted, despite the Elections Act requirement of state that voters write a date on the return envelope.