A worker prepares ballots during the vote tabulation process for Maine's 2nd Congressional District election on Tuesday, Nov. 13, 2018, in Augusta. It was the first congressional election to be decided by ranked-choice voting. Credit: Robert F. Bukaty / AP

AUGUSTA, Maine — The outcomes of four July primary elections decided by ranked-choice voting did not change after the office of Secretary of State Matt Dunlap retabulated results on Monday because of errors that led to more than 13,000 ballots being missed.

The affected races included the Republican primary for the 2nd Congressional District to challenge incumbent U.S. Rep. Jared Golden and three Democratic legislative primary races.

The error left out results from small towns that count ballots by hand and only affected the final outcomes of races that were decided by ranked-choice voting. During the initial tabulation last month, Dunlap’s office selected the wrong file when uploading ballot images and one memory device caused an error message preventing all ballot images from being uploaded.

It amounted to roughly 20 percent of ballots being missed in the 2nd District race, which was won by former state Rep. Dale Crafts of Lisbon, though it had only a small effect on the results. Crafts’ winning total was reduced by half a percentage point to 58 percent of votes.

While it had no effect on the race outcomes, it will often be cited by Republican opponents of ranked-choice voting. The state party has filed a court challenge against Dunlap over his July decision to invalidate enough signatures to keep an effort to repeal a new law expanding ranked-choice voting to presidential elections off the November ballot.

Dunlap said the error was discovered over the weekend. He said if it were a smaller number of ballots — say, around 100 — the error could be easily fixed. But the large number required a public, real-time fix, he said.

“Transparency is always your friend in something like this,” he said.

Maine has used ranked-choice voting for state primaries and all congressional elections since 2018. That year, the system encountered problems due to the way a handful of towns entered overseas votes, affecting about 6,500 votes, according to Dunlap. The state was able to recognize the issue and correct it earlier in the process.

Support for ranked-choice voting in Maine has largely fallen along political lines, with Republicans resisting its use since Golden defeated incumbent Bruce Poliquin in 2018 during a recount. It has withstood several legal challenges and is facing another in federal court now contending that exhausted ballots disproportionately affect older and less-educated voters.

Republicans have often cited the added level of complexity that ranked-choice voting adds to elections, though a 2018 exit poll by the Bangor Daily News that found Democrats and Republicans split on the method also found 74 percent of voters thought ranking choices was either somewhat or very easy.

“What do we do if this sort of thing happens in a November Presidential election?” said Jason Savage, the executive director of the Maine Republican Party, in a Facebook post. “Make the whole country wait for us to un-mess ourselves?”

Correction: A previous version of this story misidentified the number of races affected by the error.