OAKLAND — The city is planning to suspend two Oakland police officers who exchanged racial and homophobic text messages, a scandal which surfaced during one of the most tumultuous weeks in the police department’s history.

City spokeswoman Karen Boyd said the city concluded its investigation and is recommending suspension for two officers. Boyd said all employees must also take a refresher training course on a department policy related to discrimination and harassment, because some officers did not know they were required to report the misconduct.

Mayor Libby Schaaf publicly disclosed the investigation into the messages in June, as the department was already reeling from a sex scandal involving the teenage daughter of an Oakland police dispatcher.

Her disclosure occurred on the same day she announced that Chief Paul Figueroa had resigned as acting chief, a mere two days after accepting the post. He had been named the embattled department’s third chief in a week, after Sean Whent resigned and Whent’s replacement Ben Fairow was fired.

Several officers — including two who had resigned — were already under investigation for having sex with an exploited teenager who goes by the name of Celeste Guap; some of the encounters allegedly happened when she was a minor.

At the time, Schaaf pledged to root out a “toxic, macho culture” that she also described as “disgusting.”

“I’m here to run a police department, not a frat house,” the mayor said at the June 17 news conference.

The city has not named the two officers facing suspension over the text message scandal. But sources said the investigation was of a complaint filed by Sgt. Mike Gantt against Lt. Tony Jones and members of the homicide unit. Sources said the messages date back as far as 2014 and were shared or viewed mostly among African American officers, including members of the command staff. Both Gantt and Jones are black.

One of the text messages depicted a picture of member of the Ku Klux Klan suggesting the organization did not need to hurt black people because black people were killing each other, a source familiar with the text said in June.

Jones, who had a falling out with Gantt, was placed on leave as part of the investigation but has since returned to work. Gantt, a former homicide detective who handled several high-profile cases, remains on leave for undisclosed reasons. He was investigated for possibly mishandling a 2013 homicide case by letting a woman help him transcribe notes related to the killing of 66-year-old Judy Salamon. Two men charged with the slaying are awaiting trial. The Alameda District Attorney’s Office two months ago concluded Gantt would not face criminal charges.

The two officers facing suspension have the right to appeal the decision.

David DeBolt covers Oakland. Contact him at 510-208-6453. Follow him at Twitter.com/daviddebolt.