A political operative who recently left his job at the city Board of Elections was late to work so often that he was in jeopardy of being fired — before he landed a job with mayoral candidate John Catsimatidis.

Robert Hornak was late to his city job 171 times over the past 14 months, according to a time and attendance sheet obtained by The Post.

Only seven of those late arrivals were excused by his bosses in the Queens office, the document shows.

His tardiness spanned his employment on the board, from Jan. 23, 2012, to April 5, 2013, when he resigned to work for Catsimatidis directing his campaign’s Queens field operation.

He earned $60,871 and was facing a disciplinary hearing when he quit, sources said. His final check included six days of unused vacation and sick time, a board official confirmed.

“Robert Hornak is another notorious character in the Queens GOP, and the fact that he was a public employee that never showed up on time and was still able to keep his job at a time when so many other New Yorkers are struggling to find jobs or keep the jobs they already have is disgraceful,” said City Councilman Eric Ulrich, a Queens Republican who is at war with Catsimatidis.

Ulrich supports Joe Lhota in the mayoral primary.

Hornak blamed his tardiness on “a medical disability that contributed to my being a few minutes late on a number of occasions. I requested and received a reasonable accommodation to my work schedule, and after that was granted, I did not have another unexcused lateness the rest of my tenure.”

But one Board of Elections official who requested anonymity said Hornak was often hours late to work.

“Sometimes two hours, an hour and a half,” the official said.

A spokesman for Catsimatidis declined comment.

Hornak is embroiled in a civil war in the Queens Republican Party, whose vice chairman, Vince Tabone, was nabbed in the larger bribery scandal that ensnared state Sen. Malcolm Smith (D-Queens) and City Councilman Dan Halloran (R-Queens).

Tabone has since resigned his party post.

Tabone also worked for Catsimatidis, who donated tens of thousands of dollars to the party in the past year.