“Most police chiefs inherit large forces riddled with significant problems, many of them already working for local drug gangs, ” Mr. Guerrero said. “Morelia is not Mexico.”

Mr. León will step down this coming week when a new mayor takes office. It is unclear whether his program will be kept in place. This kind of turnover is common and remains one of Mexico’s biggest problems in establishing a consistent security policy.

“There are no shortcuts to transforming police corporations or dealing with crime,” said Mr. Canales, the management professor. “You have to give time for these efforts to mature and blossom.”

But at least some of the changes that took hold over the past three years will remain.

On a recent morning, Officer Jessica Gutiérrez addressed a primary school classroom packed with children and their parents: “We are here to protect you and help you, not to hurt you,” she said.

A 26-year-old psychologist, she had dreamed of becoming “a real life super hero,” a police officer who would keep citizens out of harm’s way. But when she told her family she wanted to attend the police academy a year and a half ago, they rejected and ridiculed the idea, she said.

“Now they call me all the time to help them sort out all kinds of problems,” she said.

“I realized if I can change my own family’s perspective, I can change that of the rest of society.”