North Carolina election officials on Thursday ordered a new contest in the 9th Congressional District, ending a dramatic months-long investigation into allegations of widespread ballot-tampering and potentially refocusing the national debate about election fraud.

The board voted unanimously to throw out the November results between Republican Mark Harris and Democrat Dan McCready after Harris, an evangelical minister from Charlotte, admitted under oath that he was mistaken in his testimony earlier in the day. Harris blamed the error on a recent sepsis infection that he said caused two strokes and affected his memory.

“It appears to me the irregularities and improprieties occurred to such an extent that they tainted the results of the entire election and cast doubt on its fairness,” said the board chairman, Bob Cordle. “I believe the people of North Carolina deserve a fair election and deserve to have their votes counted properly.”

Harris was under scrutiny for hiring a political operative, Leslie McCrae Dowless, who allegedly assembled a crew of election workers to illegally collect, fill out and forge mail-in ballots in two rural counties in the 9th District.

It was a different kind of election fraud than has typically made headlines. Republicans, led by President Trump, have alleged widespread voter fraud, particularly among noncitizens, and have advocated strict ID laws and criminal prosecutions. Democrats have argued that the kind of in-person fraud Republicans have targeted is rare — and have accused their opponents of ignoring actual evidence of campaign-driven fraud in Bladen and Robeson counties because it benefited them.

Thursday’s abrupt bipartisan conclusion to what had been a deeply rancorous process offered hope to some who believe the kind of fraud alleged in the 9th District often goes undetected and unprosecuted — leaving rural and often impoverished communities without fair elections or representation.

“This case told a very well-sourced story about how election fraud changes a community, exploits a community and can lock in deeply problematic leadership,” said Josh Lawson, general counsel for the State Board of Elections. “It doesn’t scale much bigger than Congress, and if it does, we’re in a lot of trouble.”

Later, the board will set a date for a new election, probably including primaries. McCready has begun preparing for a new election and is expected to run again. It appeared less likely that Harris, who had led in unofficial returns by 905 votes, would do so. The 9th District, stretching along the South Carolina border from Charlotte to eastern North Carolina, is home to the last undecided congressional race from the 2018 cycle.

“His health concerns are real,” attorney David Freedman said of Harris, his client. “I’ve not been able to discuss those. I thought three weeks ago we weren’t going to have a hearing for another reason. That’s real stuff. He about died. So it’s too soon to say what his plans are.”

Robin Hayes, chairman of the North Carolina GOP, said the party supported Harris’s decision and wished him well “as he recovers from his illness.” Hayes said voters “deserve nothing less than the full confidence and trust in the electoral system.”

The board’s decision capped a dramatic week that included testimony from Harris’s son, John Harris, a federal prosecutor, who said Wednesday that he warned his father in phone calls and emails that he believed Dowless had broken the law in a previous election and should not be hired for the 2018 campaign.

Mark Harris hired Dowless anyway.

In one email exchange displayed during John Harris’s testimony, father and son discussed whether to hire Dowless. The younger Harris wrote: “Good test is if you’re comfortable with the full process he uses being broadcast on the news.”

In his testimony Thursday, the elder Harris maintained as he had in interviews with reporters that he was unaware of red flags about the operative’s alleged tactics — notwithstanding what his son told him in spring 2017.

He also explained that he learned Tuesday night in a phone conversation with another son, Matthew, that John Harris would testify. Harris described that he had seen John Harris walking into the building a few times this week and that he didn’t understand why.

He recalled that Matthew Harris paused for a moment and said, “I don’t know if I should tell you, but I don’t want you to be shocked. John has been subpoenaed by the state board and will be testifying in this hearing.”

Lawson, the board counsel, asked Harris if he had told anyone this week that he did not expect his email exchanges with John Harris to be made public in the hearing. Harris said four times that he did not recall.

After the fourth time, Harris’s lawyer, Freedman, abruptly stood up and asked to speak to the five-member board in private.

When the board reconvened, Harris took the stand again and explained that he had been mistaken about that recollection — and had in fact told his younger son, Matthew, in the phone conversation Tuesday evening, that he did not expect those emails to surface the next day.

Harris said the episode made him realize that he was not prepared for the “rigors” of the evidentiary hearing. He called for a new election, then promptly excused himself from the proceeding and walked out.

“I believe a new election should be called,” Harris said, eliciting gasps from the hearing room in Raleigh. “It’s become clear to me that public confidence in the 9th District has been undermined to an extent that a new election is warranted.”

Marc Elias, a prominent Democratic lawyer from Washington representing McCready, told reporters that he welcomed the board’s decision but hoped the episode would make it more difficult to ignore the kind of ballot fraud that happened in the 9th District. He accused Republicans of continuing to oppose a new election up until the moment of Harris’s stunning announcement.

“For all of the talk that Republicans have about the integrity of elections and election fraud, when they were confronted with ever more evidence of a massive fraud scheme, the Republican Party doubled down on it,” Elias said.

Elias also said that he had been prepared to vigorously cross-examine Harris about his potentially “untrue” statements, and he guessed that Harris’s legal team abruptly stopped his testimony “to spare Harris of potentially giving further answers that would expose him to legal jeopardy.”

Thursday’s developments turn attention to the potential for criminal prosecutions. Both the State Bureau of Investigation and the Wake County district attorney, in Raleigh, are investigating the allegations.

Even after admitting that he was mistaken in his testimony and saying a new election was warranted, Harris maintained that he knew nothing about Dowless’s alleged tactics.

Earlier Thursday, Harris said he hired Dowless on the advice of a number of Republican friends and colleagues. He said he believed Dowless when he offered to run a legal absentee-ballot program for Harris’s campaign.

Harris, 52, said he didn’t follow his son’s advice in part because John Harris was just 27 years old at the time. He added that the younger Harris, now 29, is “a little judgmental and has a little taste of arrogance and some other things. And I’m very proud of him and love him with all my heart.”

Harris also explained on the witness stand how he had met Dowless, a 63-year-old native of Bladen County

Dowless was a “good ol’ boy” who “ate, slept and drank” politics and was recommended to him by a former state judge, Harris said. He met Dowless in 2017 at a furniture store in the 9th District, and the two, along with other Republicans, sat on couches in the store's showroom so that Dowless could describe his absentee-ballot operation.

Harris had heard that Dowless was responsible for delivering an overwhelming share of the absentee ballot vote in the 2016 Republican primary for Todd Johnson, which Johnson and Harris had lost to the incumbent at the time, Robert Pittenger. Harris was still smarting that he had lost to Pittenger by so few votes and believed that if he had hired Dowless that year, he would have won.

“I turned to McCrae and said, ‘Well, what makes you so special? What is it that you do?’ ” Harris recalled.

Harris said Dowless explained to him that his operation was strictly legal. He would hire workers who would collect ballot request forms from voters, then return once actual ballots had been sent out and help the voters fill out and mail the ballots. “We don’t touch the ballots,” Harris recalled the operative saying. Collecting or filling out another voter’s ballot is a felony in North Carolina.

Harris’s testimony drew skepticism from some board members — and criticism for a lack of oversight of Dowless’s tactics. No one on the campaign, for instance, checked to make sure Dowless was actually performing the services he was being paid for.

Harris was also questioned about the fact that Dowless paid his workers for each ballot request form they turned in, which board members said should have raised a red flag. In the end, the Harris campaign paid Dowless more than $130,000 during the 2018 campaign.

Harris claimed very little knowledge about the inner workings of his campaign, which he said was handled primarily by his campaign consultant, Andy Yates of Red Dome Group. Yates completed two days of testimony Wednesday and also denied knowledge of Dowless’s alleged tactics.

In addition to calling for a new congressional election, the elections board called for new elections for two local Bladen County offices, one on the county commission and another on the county soil and water board.

Kirk Ross in Raleigh contributed to this report.