Itasca County Sheriff Vic Williams eked out a slim victory over challenger Bryan Johnson, a fired former deputy, in a messy rematch of their 2014 race.

Final tallies showed Williams edging out Johnson 44 to 43 percent. A sizeable number of voters refused to mark the ballot next to either candidate's name, with more than 12 percent casting write-in votes.

With the win, the 49-year-old Deer River native will enter a third four-year term as the county's top law enforcement officer.

"Thank you to the citizens of Itasca County," Williams wrote on his Facebook page early Wednesday. "I truly appreciate your support."

Tuesday's election marked the end of a contentious battle between Williams and the man he terminated earlier this year in wake of an investigation into false timecard entries.

An arbitrator in September found that Williams was justified in firing Johnson, who was found to have displayed a "pattern of dishonesty." Johnson, a 43-year-old Bovey city councilor, at one point faced a felony theft charge, though prosecutors later dropped the case.

An independent investigator also recently concluded that Johnson violated several county policies by allegedly downloading pornography and sending "sexually charged and explicit" messages from his work phone, among other infractions - charges that he denied.

Johnson, however, alleged throughout the campaign that he was the target of retaliation and false claims from Williams. A labor attorney also was planning to appeal the arbitration decision.

Williams' leadership has come under fire from other employees as well, with several bringing lawsuits in recent years. One wrongfully terminated deputy, Michael Bliss, recently received a settlement in excess of $500,000 from the county and its insurance company after filing retaliation claims.

Williams and Johnson squared off four years ago, when the incumbent cruised to re-election by a margin 62 to 37 percent. That time around, only 0.16 percent of ballots saw write-ins.

With significantly higher turnout this year, Johnson actually gained more than 2,000 votes, while Williams dropped more than 2,300 over the last election cycle. In the final, but unofficial results, Johnson came up 219 votes short of unseating his former boss.

Neither candidate returned calls from the News Tribune.