Republican John Safford declared victory in a three-way race for mayor of Saratoga Springs on Tuesday night, putting him in line to become the first GOP mayor of the Spa City in 10 years.

With all 25 election districts reporting, Safford led Kim with 3,752 votes to Kim's 3,172. Mathiesen, who lost a Democratic primary to Kim and ran on the One Saratoga line, had 1,420 votes. 

Safford's team said Kim stopped by an after-election party to congratulate him on the win.

Safford, a Vietnam veteran and entrepreneur, appeared to have made a dramatic political comeback after losing a run for mayor several years ago. He focused his campaign on safety, civility and low taxes, and would be the first Republican to hold the mayor's seat on the five-member council since Scott Johnson in 2013.

Kim was seeking a second two-year term. He also appeared on the Working Families line, and ran on an incumbent's message, saying he wanted to expand on the work he's done.