Bill Prim prevailed by a slim margin of 98 votes in the Republican primary for sheriff in McHenry County against Undersheriff Andrew Zinke.
Prim, of Cary, had 14,516 votes while Zinke, of Woodstock, had 14,418 votes with all 212 precincts reporting, according to unofficial results on Tuesday night.
The total does not include provisional and late absentee ballots, McHenry County Clerk Kathy Schultz said.
Prim, 54, is a retired Des Plaines police commander who works as a court security officer in Lake County.
Morale within the sheriff's department is low because the rank-and-file feel they are ruled with an iron fist, Prim said.
Zinke, 45, said Prim is talking only to a small percentage of disgruntled employees who are unhappy because of the department's accountability and performance standards.
Prim criticized the sheriff department's $33.4 million budget, which he said has grown more than any other county department's budget in the last few years.
Zinke said the department has been on a maintenance budget for about a decade, and he attributed cost increases to salaries, pension payments and health insurance premiums.