Even on election night, hours after the polls closed, Suffolk County's battling candidates for District Attorney couldn't agree.

Interim Suffolk County District Attorney Kevin Hayden, a career prosecutor, declared victory early Wednesday morning in the Democratic primary for the office he currently holds.

At the same time, Hayden’s opponent, Boston City Councilor Ricardo Arroyo, refused to concede. Instead, Arroyo told supporters he is “waiting” for all votes to be counted.

The Associated Press called the race in Hayden’s favor Tuesday evening just before midnight, shortly before the two men began addressing their respective camps.

Hayden emerged from relative political obscurity when he was appointed to the DA’s office by Governor Charlie Baker in January, replacing Rachael Rollins who became U.S. Attorney.

Although he had the power of incumbency, political observers discounted Hayden early on.

He defied the odds, overcoming allegations of attempting to dismiss a police misconduct case and besting a seasoned politician with the help of the Boston Globe’s reporting on a pair of nearly 20-year-old sexual assault investigations involving Arroyo.

The Globe also reported the allegations against Hayden.

“We’ve always tried to stay focused on our mission,” Hayden told GBH News after his victory speech. “I think the voters decided that they would go with the right person for the job, who really had the experience to do the job. And I do.”

Fighting gun trafficking and opioids, encouraging community engagement, and seeking alternatives to jail for juvenile offenders will remain his top priorities, Hayden said in his election night remarks.

“It has been quite an adventure, but we did it,” he told his supporters in the South End early Wednesday morning, thanking his wife and God at the outset.

Patricia McCormack, a 71-year old supporter who said she spent eight hours campaigning for Hayden on Election Day, said the prominence of his family in his campaign remarks are part of what inspired her to vote for him.

“He just was decent. He was always talking about his wife and kids, and he was talking about his dad…So I found him compelling,” McCormack said.

“It's easy to see him as a human and it's easy to believe that he means what he's saying,” she added.

The City Council embroiled

The primary polarized the Boston City Council with conservative Councilors Frank Baker and Erin Murphy publicly backing the more moderate Hayden over their council colleague.

At Hayden’s victory party, Murphy said the top reason she supported Hayden early on was his experience.

“He's been working in the courts for decades now,” Murphy said. “Second reason is, once I got to know him more and I saw his family and his upbringing, I just knew his morals and the type of guy he is, type of father he is and has been. He's a deacon at his church and the community really respects him.”

Councilors Ruthzee Louijeune, Julia Mejia, Gabriela Coletta, Tania Fernandes Anderson and Kendra Lara supported Arroyo. Only Lara was on hand for Arroyo’s election night party.

“When we fight the system, the system fight back, don’t it,” she said, introducing Arroyo to a small crowd of about 30 supporters.

Asked about the AP race call, Arroyo said he would not delay a concession “once the numbers show” a statistically impossible victory.

“We know that folks have called races before they’ve actually been finished,” he said.

Arroyo also told reporters that stories about his past sexual assault investigations undeniably played a role in the election results.

Emily Anesta, an Arroyo supporter, agreed and added that timing played a role.

“There were a lot of people who supported Ricardo’s policies, were concerned or dismayed by Hayden’s performance as interim DA and didn’t have the time, the bandwidth…to understand the facts of what [was] going on,” she said.

“It took a lot of time,” Anesta said, admitting that her support for Arroyo waivered briefly as the Globe continued its reporting.

The allegations also led City Council President Ed Flynn, who won the presidency by striking a deal with Arroyo and a key bloc of council votes in exchange for plum committee assignments, to take the extraordinary step of stripping Arroyo of his committee chairmanships.

The decision, Flynn said, is due for review within the next two months.

Sparring between the Arroyo and Hayden campaigns was fierce even prior to media reports of competing scandals.

Fireworks began when Boston Mayor Michelle Wu waded into the race, throwing her support behind Arroyo, a former council colleague.

Wu, and many other high-profile democrats, eventually withdrew their support after the Boston Globe published an interview with the woman who first reported Arroyo to police.