WATERLOO, Iowa — The mayor of Waterloo ordered the city’s police chief Monday to focus on rebuilding public trust after several highly publicized missteps involving white officers’ interactions with black residents.

Mayor Quentin Hart said at a news conference that he would let Daniel Trelka keep his job, ending speculation that the chief would be forced out. Hart said that, after weeks of conversations, he decided Trelka “is the one who can help us address the myriad challenges” the city faces.

But Hart stripped Trelka of his role leading the fire department and directed him to focus for the next year on implementing a community policing plan that restores “public trust that has been lost due to some of our shortcomings.” Trelka, who serves at the pleasure of the mayor, had been in charge of both police and fire as Waterloo’s director of safety services.

Trelka’s job as police chief — which he’s held since 2010 — had been in jeopardy after his officers came under scrutiny in recent weeks following reporting by The Associated Press. Waterloo, a city of 68,000, has Iowa’s largest percentage of black residents at 16 percent but a police force with only 2 black officers out of 124.

City council members had been outraged by unconfirmed news reports last week that Trelka had been asked to resign, saying the mayor had kept them in the dark about his status. Trelka’s supporters took to social media in a campaign to save his job and had planned to speak out at a Monday council meeting.

City councilor Ron Welper said that Trelka “has done a wonderful job here” and his departure would have been an unpleasant surprise.

Hart, the city’s first African-American mayor, left Monday’s news conference without taking questions. He said the recent articles and videos about police misconduct were “shocking” but didn’t represent the city. He said the police department and City Hall each had “room for improvement” and would work together to make changes.

Hart didn’t detail what he had in mind but spoke of improving community outreach and implementing best practices. Trelka, appearing with Hart, vowed to make “some adjustments” for the betterment of the city.

The city recently settled four lawsuits involving allegations that officers used excessive force on and illegally arrested black residents, including a 13-year-old girl who was handcuffed and a 17-year-old who was thrown to the ground. None of the officers involved were disciplined.

Video provided to The Associated Press by a black suspect’s lawyer shows a white officer yanking the hair of the handcuffed suspect and hitting him in the head after a police chase. A prosecutor declined to charge the officer with assault, saying he was “understandably agitated.” But Trelka said that officer was disciplined.

Testimony at a murder trial last month showed officers laughing and joking at the scene where a black teenager had been fatally shot, with one saying the teenager wasn’t a “real victim” and that “we just need a semi-apocalyptic event to get rid of 90 percent of them.” Trelka also said that another officer had been disciplined for using a racial slur this summer while arresting a black resident.

In January, the city agreed to pay $2.5 million to settle a lawsuit filed by the family of a black man who was fatally shot by a white officer in 2012.