A beleaguered San Francisco Police Department took another hit to its tarnished image Tuesday with the release of racist and homophobic text messages the chief says were exchanged between four officers.

The city's public defender released transcripts he said show offensive texts sent and received by former officer Jason Lai, who resigned earlier this month. The messages belittle blacks, Latinos and Indians and insult President Barack Obama and NBA superstar LeBron James, among many other disparaging conversations.

Police Chief Greg Suhr says Lai and three other officers exchanged inappropriate texts and that three of them have either quit or retired since last summer. He is seeking dismissal of a fourth officer.

"It makes me sick to my stomach," said Suhr, who said the entire department of nearly 2,000 sworn officers will undergo "implicit bias" training by year's end. He apologized to San Francisco.

It's the second such text-messaging scandal to shake the department since it was disclosed in late 2014 that a group of officers exchanged racist and homophobic text messages in an unrelated case.

The current texting scandal began last year when a woman accused Lai of rape after night of heavy drinking. Lai was a patrol officer at the time.

The San Francisco district attorney said in March there wasn't enough evidence to charge Lai with rape, but the former officer was charged with misdemeanors for illegally accessing driving and criminal records.

The offensive text messages were found on Lai's personal cellphone, which was seized as part of the investigation. The text messages found on the phone were sent to colleagues in 2014 and 2015.

"Indian ppl are disgusting," one of the texts reads.

Other texts use a slur to describe Mexican people.

A text stating "burn down Walgreens and kill the bums" was also found on Lai's phone.

The text messages were released by Public Defender Jeff Adachi, who is representing a defendant in a case involving Lai.

"This isn't a slip of the tongue," Adachi said. "This is a person who is fully committed to expressing his bias to his friends."

The police chief said three other officers also sent similar messages to each other that were "no less reprehensible." Transcripts of those messages weren't released.

Adachi says the texts may be more than just poor taste and bigotry. He said his office is reviewing 207 criminal cases Lai helped investigate for possible dismissal.

In one instance, Adachi said, Lai used language in a text that implied he may have falsified a police report.

"Here's a story I wrote,' Lai texted. The police report was attached and sent to a friend.

In another instance, Lai's text says he was so angry with a suspect that "I wanted to hook her up for misappropriation of found property."

Lai's attorney, Don Nobles, didn't return phone calls seeking comment.

The text messages also said the sender hates James, of the Cleveland Cavaliers, calling the basketball player the "n" word. A Cantonese slur for black people was used several times last year while describing a shooting and ridiculed a suspect who sustained gunshot wounds.

"Too bad none of them died," Lai's text said. "One less to worry about."

Lai allegedly texted a colleague during a night of civil unrest in Baltimore after Freddie Gray, a black man, died after his neck was broken in the back of a police van.

"They're like a pack (of) wild animals on the loose," the text said of blacks protesting Gray's death.

The latest texting scandal comes amid the department's attempts to repair frayed relationships with many of the city's black residents and others angered by the previous round of inappropriate messages exchanged among officers. The department's community relations worsened after officers fatally shot two knife-wielding minority suspects in the last two months.

Suhr has said he will not heed calls to resign and is working to overhaul the department's use-of-force policies. Mayor Ed Lee said he supports the chief's reform efforts, which include calling in the U.S. Department of Justice to review the Police Department's policy and procedures.