BALTIMORE—Baltimore’s mayor has replaced Police Commissioner Anthony Batts, citing “utmost urgency” to stop a recent surge in violence.

“We cannot grow Baltimore without making our city a safer place to live,” Stephanie Rawlings-Blake said Wednesday at a news conference at city hall. “We need a change. This was not an easy decision, but it is one that is in the best interest of the people of Baltimore. The people of Baltimore deserve better.”

Rawlings-Blake named Deputy Police Commissioner Kevin Davis interim commissioner, effective immediately.

Her decision came hours after she lashed out at the city’s police union for its highly critical report of the police department leadership during spring rioting. She did not respond to a call for Batts’ resignation from faith coalition Baltimoreans United in Leadership Development.

She said the Fraternal Order of Police report did not play a role in her decision. Instead, she said, her motivation was the spate of murders that has erupted in the city over the past month.

Rawlings-Blake commended Batts for his service, citing improvements in transparency and accountability.

“Over the past three years, Commissioner Batts has served our city with distinction,” she said.

But she said new leadership was needed to stem a recent surge of violence, including the deaths of three people in a quadruple shooting near the University of Maryland, Baltimore, on Tuesday night.

The city’s homicide rate spiked soon after riots overtook much of West Baltimore on April 27. The city recorded 42 homicides in May, the deadliest month in 25 years. There have been 31 homicides in the past month.

Batts has led the city’s police force since October 2012. He last served as police chief in Long Beach, Calif., and Oakland, Calif. He earned more than $200,000 a year.

Delegate Curt Anderson, co-chair of the state’s new working group on public safety, said the move was inevitable.

“I know there was a lot of frustration over what was going on in Baltimore,” Anderson said. “Clearly when the discussion about the police commissioner becomes more important than actual problem, the mayor has to remove that obstacle.”