San Francisco Mayor Edwin M. Lee said Thursday that he had removed the chief of his city’s embattled police department, a decision that came hours after a police officer in the city fatally shot a woman.

The move came as the city’s police force is facing criticism over fatal shootings as well as a controversy involving bigoted text messages sent by officers. While Lee (D) had previously stood by Gregory P. Suhr, the city’s police chief since 2011, he changed course on Thursday after the latest shooting.

Lee said during a news conference that he had asked Suhr to resign after more than three decades with the force. The mayor still had kind words for Suhr after his resignation, calling the outgoing chief “a dedicated public servant,” but Lee said he felt that a change was needed as the city confronts a tangled knot of protests and controversy.

“I have previously expressed confidence in Chief Suhr because I know he agrees with and understands the need for reform,” Lee said. “Today I have arrived at a different conclusion to the question of how best to move forward.”

This decision comes at a moment of increased scrutiny for how police use force, amid nationwide calls for reform and an influential law enforcement group pushing stronger de-escalation training, though police unions and some other officers and chiefs have said they worry such a proposal could lead to dangerous hesitation.

Earlier on Thursday, before Suhr’s forced resignation was announced, police offered an accounting of a fatal shooting in the city’s Bayview area.

The San Francisco police said that two officers looking for a stolen vehicle came across a woman sitting in a parked car that had been reported stolen. When these officers made contact with her, the woman fled and drove into a parked car, according to a police statement.

“While the officers were trying to take the suspect into custody, she moved the vehicle in a forward and backward direction,” the statement said. “At some point in the engagement, one officer fired one shot striking the suspect.”

This woman was taken to a nearby hospital where she later died, authorities said. The officers involved in the episode have been placed on administrative leave during the investigation.

Suhr becomes the third police chief of a major police department to be dismissed after fatal shootings sparked demonstrations and anger.

Chicago Mayor Rahm Emanuel (D) removed his police superintendent, Garry F. McCarthy, after heavy protests prompted by video footage of an officer shooting a teenager 16 times. Before that, Baltimore Mayor Stephanie Rawlings-Blake fired her police commissioner, Anthony Batts, saying he had been a distraction as the city reeled from rioting after the death of Freddie Gray.

Suhr’s removal was met with dismay by a police union in San Francisco that praised his tenure leading the department.

“It is a great disappointment that he is departing the police force after having given so much of himself during a very difficult period,” Martin Halloran, president of the San Francisco Police Officers Association, said in a statement.

“His retirement under pressure is an extreme loss to the department and the city,” Halloran said. “Chief Suhr, at the core, was and always will be a cop’s cop and dedicated to the men and women who don the uniform every day to serve and protect.”

Lee named Toney Chaplin — like Suhr, a longtime veteran of the city’s police department, and until Thursday one of its deputy chiefs — as the new acting chief of police for the department, one of the largest in the country.

“The men and women of the San Francisco Police Department put themselves in harm’s way literally every day,” Lee said. “We owe it to them to restore the community’s trust in their department and their work.”

Halloran said the police union looked forward to working with Chaplin, describing him as “more than capable of leading this fine department during this transition.”

In December, police officers shot and killed Mario Woods, a 26-year-old, sparking heated protests after Woods was seen in a video recording walking away from a larger group of officers and toward one officer when he was shot. That was one of several incidents, including the shooting of a homeless man holding a knife last month, that prompted demonstrations and calls for reform in the city.

Meanwhile, the department has also been under fire for a series of racist and homophobic text messages that were sent between officers.

The Justice Department is carrying out an examination of the San Francisco force, one that is being conducted by the federal agency’s Office of Community Oriented Policing Services.

Rather than a civil rights investigation, the type of probe launched into the departments in Baltimore and Chicago after protests there, this type of inquiry is known as a collaborative review and ends with publicly released progress reports rather than a court-ordered agreement.

Further reading:

This story has been updated with new information. First published: Thursday at 8:46 p.m.