A high-ranking official in the Los Angeles County Sheriff’s Department resigned on Sunday after it was revealed that he had shared a series of racist and sexist jokes from his work email account in a previous job with the Burbank Police Department.

Sheriff Jim McDonnell of Los Angeles County said in a statement that the official, Tom Angel, his chief of staff, had resigned on Sunday. His resignation came days after The Los Angeles Times first reported on the emails, which the newspaper said were obtained under the state’s open records act.

“This incident is one that I find deeply troubling,” Chief McDonnell said. “Despite the Sheriff’s Department’s many recent efforts to fortify public trust and enhance internal and external accountability and transparency, this incident reminds us that we and other law enforcement agencies still have work to do.”

Last Wednesday, The Times published 15 pages of email correspondence that contained jokes about Muslims, Catholics, Latinos, African-Americans and women.