Story highlights Sheriff Jim McDonnell says he will use the situation as a "learning opportunity"

The Los Angeles Times first reported on the emails by No. 2 official Tom Angel

(CNN) The No. 2 official in the largest sheriff's office in the country, the Los Angeles Sheriff's Department, has resigned following reports he sent racist and inflammatory emails on his work account a few years ago.

"I took my Biology exam last Friday," the Los Angeles Times quoted one of the Tom Angel's emails as saying. "I was asked to name two things commonly found in cells. Apparently 'Blacks' and 'Mexicans' were NOT the correct answers."

Another email included a list of reasons why "Muslim Terrorists are so quick to commit suicide," according to the Times. The list included wearing "towels for hats" as well as "constant wailing from some idiot in a tower" and claims that "you can't wash off the smell of donkey."

Top L.A. County sheriff's official resigns over emails mocking Muslims and others https://t.co/9tHksDUeLK — Los Angeles Times (@latimes) May 1, 2016

Angel sent the emails while the No. 2 official at the Burbank, California, Police Department, according to the sheriff's department.

Sheriff Jim McDonnell initially told the Times that the messages were "divisive and unproductive" but that he had no plans to discipline Angel.

Read More