Either Janet Mills or Adam Cote will be on the ballot for governor in November, but it will be days before Mainers know which of the two represents the Democratic Party this fall.

With 80 percent of precincts statewide reporting, Mills continued to lead Cote by just under 5,000 votes on Wednesday morning. But Mills’ 33 percent share of the vote totals – compared to Cote’s 28.5 percent – was well below the 50 percent threshold needed to win the race outright.

As a result, Maine will see its first ranked-choice voting tabulation for a statewide race starting on Friday.

Both campaigns were closely watching the remaining returns trickle in while gearing up for an unpredictable – and unprecedented – process to determine the Democratic gubernatorial nominee.

“We are cautiously optimistic,” Mills campaign manager Michael Ambler said late Wednesday morning. “Obviously there is still a ways to go to figure out who the winner is.”

Cote’s camp was also feeling optimistic.

“We are confident that when the votes are all counted, we will be the Democratic nominee and cannot wait to take on Shawn Moody and his steadfast support for the economic philosophy that has Maine lagging New England and the country when it comes to job, income, and economic growth,” Cote said in a statement.

Mills and Cote have long been regarded as the two frontrunners in the seven-person Democratic field, although ranked-choice voting has introduced additional uncertainty into the race. Either will face off in November against Moody, a Gorham businessman who avoided the ranked-choice process by winning 56 percent in the four-person Republican primary, based on vote totals available Wednesday morning.

Mills, of Farmington, has substantial statewide name recognition thanks to her high-profile position as Maine’s attorney general. Cote is an Sanford attorney and 20-year veteran of the Maine Army National Guard who was the first major candidate to enter the Democratic primary race in April 2017.

Lobbyist and advocate Betsy Sweet of Hallowell was trailing the two leaders on Wednesday with 16.2 percent of the vote, followed by former House Speaker Mark Eves of North Berwick at 14.3 percent. It is mathematically impossible – short of a miracle – for either Sweet or Eves to win the nomination even with the reallocation of votes during the ranked-choice process, however.

Mainers likely won’t know whether Mills or Cote won the Democratic nomination until Friday at the earliest – and potentially next week.

Under the ranked-choice system, voters select candidates in order of preference. If no candidate receives more than 50 percent of the vote in the first count, the candidate with the fewest first-choice votes is eliminated. Voters who preferred the eliminated candidate would then have their ballots added to the totals of their second-ranked candidates, and the ballots are retabulated. The process continues until one candidate has a majority and is declared the winner.

Secretary of State Matt Dunlap’s office is not expected to begin that retabulation process until Friday because, by law, towns have three days to send voting ballots to Augusta. A private courier service hired by the state is expected to begin collecting the paper ballots and memory devices containing electronic voting records on Thursday for transport to Augusta.

The actual tabulation process will take place at the Elkins Building located at the former Augusta Mental Health Institute campus in Augusta, across the Kennebec River from the State House. The process is open to the public and will be conducted between 9 a.m. and 5 p.m., Monday through Friday.

It is unclear how long the process will take, however. While running the ranked-choice algorithm on the computers will go quickly, staff must first feed paper records from towns that still hand-count ballots into the tabulation machines.

Adam Cite and Janet Mills.