Last December, Milwaukee Police Department internal affairs detectives began investigating an officer accused of misusing Flock, the department’s automated license-plate reader system.

The detectives investigating officer Josue Ayala found he secretly used Flock to learn the location of his romantic partner 124 times and that partner’s ex 55 times, according to a February criminal complaint.

Ayala agreed to resign from the department and plead guilty to attempted misconduct in public office as part of a deal, according to court records.

Then earlier this month, one of the detectives who had investigated Ayala was himself arrested for misusing the Flock system. The detective, Tehrangi Chapman, admitted to using Flock to track two people and to secretly installing a GPS device on one person’s vehicle, according to a criminal complaint.

The incidents are among at least two dozen cases in which officers resigned or were arrested for allegedly abusing Flock’s automated license-plate reader system to stalk romantic interests, according to a tally from the Institute for Justice, a nonprofit public interest law firm.