ALBUQUERQUE, N..M. (AP) — Albuquerque has paid a settlement of over $500,000 to a former police commander who filed a whistleblower lawsuit against the city.

The settlement ended the case right before a scheduled trial on the suit filed by John Sullivan, who formerly headed Albuquerque’s police academy before he was demoted and then retired in 2018, KOAT-TV reported.

Sullivan’s lawsuit alleged he was punished because he told the U.S. Department of Justice that he was not getting the resources he needed to make changes at the academy that were mandated by a civil rights settlement agreement.

Sullivan’s attorney, Tim White, said the city approached him about settling the case the night before the scheduled start of the trial during which Mayor Tim Keller and current Police Chief Harold Medina were to testify.

Police Department spokesman Gilbert Gallegos said the city settled the lawsuit “primarily because it focused on employment decisions made by Mike Geier when he was chief at APD.”