San Francisco Police Chief Greg Suhr, with his command staff and community and religious leaders behind him, speaks during a news conference Friday, April 29, 2016, in San Francisco. (Eric Risberg/AP)

San Francisco's police department has a racism problem.

Since criminal probes into three officers revealed racist and homophobic text exchanges, the department's police chief has been forced to confront the problem head on.

Six pages of slur-filled text messages sent by four former officers, all tied to one of the officer's cellphones, were obtained and then shared by the city's public defender this week, many of which contained disparaging references to black, Indian, Latino, Muslim, homeless, gay, and transgender people.

Texts like "Indian ppl are disgusting" and "Burn down walgreens and kill the bums." They also describe black people as "wild animals on the loose."

Chief Greg Suhr, joined by religious and minority community leaders, announced at a press conference on Friday that all officers in the department will be ordered to complete an anti-harassment class by the end of May. Suhr also announced the release of more transcripts of text messages to the Associated Press.

"The vast majority of police officers are shaken," Suhr said in an interview with AP. "The expectations have never been higher, so when officers do something like this, the disappointment can't be greater."

In the latest batch, officers reportedly mock black people in Ferguson, Missouri, where police shot and killed an unarmed black man in 2014. They insult colleagues they suspect of being gay, and describe minority suspects using racial slurs.

Suhr said on Friday that he does not intend to resign, and that the city's mayor, Ed Lee, supports that decision. Lee sent a letter to the department of almost 2,100 officers on Thursday urging them to report their colleagues who display racist or bigoted behavior.

The scandal centers around Officer Jason Lai. Public Defender Jeff Adachi said the messages first came to light in a separate police probe of Lai. The San Francisco District Attorney's Office ultimately charged Lai with six misdemeanor counts of unlawful access and use of criminal and Department of Motor Vehicle information.

Lt. Curtis Liu was also implicated in the texts, but retired last year. A third unidentified officer has resigned, and a fourth unnamed officer faces dismissal.

Adachi expects the messages to have wide repercussions, and could affect more than 200 criminal cases, including three murders.

"It is chilling how casually former officer Lai dehumanizes the citizens he was sworn to serve," Adachi said in a statement. "He wished violence upon the very people he was being paid to protect and none of his colleagues turned him in."

"There is no room in this department for anyone who holds these types of hateful and discriminatory views," Police Chief Greg Suhr said in a statement.

Protesters have been calling for Suhr's ouster since last December, after police shot and killed Mario Woods, a black stabbing suspect who was not carrying a gun.

The US Justice Department has launched a collaborative review with the department, falling short of the federal civil rights investigation critics of the department called for.