A Boston police detective made more than four times his base salary last year, increasing his pay through a contract provision that allowed him to receive roughly four months of overtime for hours he didn’t work, records show.

Boston Police Detective Waiman Lee, a 34-year department veteran in the domestic violence unit, took home about $403,000 in 2016, making him the highest paid city employee last year, according to payroll records. His base salary was $92,515.

In what critics call an extreme example of a systemic problem, Lee bolstered his wages thanks to police union contracts that require that officers who work detail shifts or testify in court be paid a minimum of four hours, even if the assignment lasts only 30 minutes.