A recount has confirmed Allegheny County Controller Corey O’Connor won the Allegheny County Democratic Committee’s endorsement for Pittsburgh mayor in the spring primary, beating out Mayor Ed Gainey by a razor-thin margin.

The final vote was 274-270, said committee Chair Sam Hans-Greco. Six Pittsburgh committee members did not vote.

Hans-Greco said the narrow margin demonstrates how divided Pittsburghers are over Gainey’s performance in his first term.

“I think that both candidates are good candidates,” Hans-Greco said. “I think they both want to do a good job for the city.”

Hans-Greco did not publicly back either candidate, explaining he felt the committee chair should refrain from putting his “finger on the scale.”

Hans-Greco said the committee recounted ballots after the initial Sunday vote to ensure their tally was accurate because the race was so close. The recount yielded the same result.

After the initial results were announced, O’Connor told TribLive he was honored to earn the endorsement and vowed to continue outreach to voters ahead of the May 20 primary.

“I think it just builds on more and more momentum that people throughout Pittsburgh want change,” he said Monday.

Gainey in a statement said he was proud of the support his campaign received.

“In May, Democratic voters can keep moving forward on the transformational progress we’ve delivered and protect against (President Donald) Trump, his cronies, and real-estate tycoons,” Gainey said. “I welcome every person in Pittsburgh to join us in that fight.”

This marks the second consecutive mayoral race in which the committee endorsed the challenger over the incumbent. The committee in 2021 backed Gainey over then-Mayor Bill Peduto, who had not formally sought the endorsement.