The city violated a union contract by refusing to pay five high-ranking cops more than $1 million collectively in accrued compensation when they retired under fire amid the NYPD corruption scandal in 2016, a labor-relations arbitrator found.

Inspector Peter DeBlasio (no relation to the mayor) and deputy chiefs Andrew Capul, David Colon, Eric Rodriguez and John Sprague said they were threatened with disciplinary charges and terminattion if they didn’t retire and forgo accrued vacation and comp time, according to arbitrator David Stein.

They were never told what alleged misconduct they’d be charged with, according to the ruling.

All five were interviewed by the FBI during its probe of alleged bribery of top police brass by two prominent mayoral donors.

The opposing sides now have 60 days to come to a settlement.