(Updated 5:17 p.m.) After recounts in Windsor and Hartford the Secretary of the State’s office said Leo Canty won the three-way Democratic primary by the slimmest of margins — one vote.

When the polls closed last week, Canty, a labor leader from Windsor, was tied with Brandon McGee, a development director from Hartford, who was making his first run for public office. Windsor Mayor Don Trinks came in a distant third place.

“The results of the recanvass show Leo Canty with 774 votes, Brandon McGee with 773 votes and Donald Trinks with 267 votes,” a press release from the Secretary of the State’s office says. “The initial result after the August 14 primary was a tie between Canty and McGee which would have resulted in an ‘adjourned primary’ or re-vote on September 4 under Connecticut law.”

Click here for a copy of the moderator’s returns.

The new 5th Assembly District created during the redistricting process at the urging of Canty includes a majority of Windsor and two polling districts in Hartford.

“We are now 1 step closer to having a state representative from Windsor in the Legislature . . . and our first DEMOCRAT legislator since 1983,” Canty said in an email to supporters.

During the Windsor recount Friday, Canty, who wanted to go right to a re-vote, picked up a vote after he and McGee both lost a vote. An alleged missing ballot, which was assumed to have been a vote for McGee, was not found during a search Monday at John F. Kennedy School in Windsor.

After Hartford recounted its two polling districts and absentee ballots, McGee’s campaign said Canty lost one absentee ballot, which would end the race in a 773-773 tie.

However, Canty said he’s up by a vote because Hartford’s Democratic Registrar of Voters, Olga Iris Vazquez, announced that the numbers stayed the same as they were last week. Canty believes he still has 18 absentee ballots making him the winner by one vote, but the McGee campaign believes it’s 17. Each campaign and its supporters retreated Tuesday to opposite sides of Hartford’s City Council Chamber to argue their case to reporters. Canty says that when the counting was done, he had 774 votes to McGee’s 773 votes, giving him a decisive one-vote victory.

“Our numbers have not changed,” Vazquez said Tuesday.

The Secretary of the State’s office will receive the vote tallies from both Hartford and Windsor by 4 p.m. today.

Meanwhile, McGee, who called for the recount, said he’s ready to get back out and hit the campaign trail again.

Instead, he may be heading to court to challenge the final tally. McGee’s campaign said he would be talking with an attorney Wednesday about a possible path forward.