Sometimes you need a new sheriff in town.

That became clear the moment Missouri State Highway Patrol Captain Ronald Johnson took over security in Ferguson on Thursday afternoon. Three days and nights of heavily armed confrontation between local police forces and protesters gave way to hugs and handshakes, with Johnson apologizing at least to one man for his niece having been tear-gassed.

If Johnson was able to change the tone, it was because of a change in leadership. His new duties, after Ferguson and St. Louis County police were criticized by everyone from residents to the president, had been handed to him by Democratic Gov. Jay Nixon. It was unusual for a governor to take control of a local police action. And it was not without some risk.

But it turned out to be necessary. A major part of the problem in Ferguson was that no one seemed to be in charge. The public wants to see an official take the lead whenever there's a crisis, whether it's a police shooting or a hurricane. Think of Rudy Giuliani after Sept. 11, or Chris Christie in the wake of Superstorm Sandy.

Gov. Jay Nixon, right, has given police oversight of Ferguson to the Missouri State Highway Patrol under the command of Capt. Ronald S. Johnson, center, a Ferguson native.(MCT/Christian Gooden)

"Whether it's an isolated incident or a tragic accident or a natural weather occurrence that will be addressed, the community wants to know that somebody's in charge," said Steve Hogan, the mayor of Aurora, Colo., who led the response to a movie theater shooting in 2012 that left 12 people dead. "Someone has to step up and say, 'Yes, we're aware it happened, and, yes, we're dealing with it and we're dealing with all of it.'"

That wasn't the case in Ferguson. Although Ferguson police took the heat, it's not clear that the city's own officers were responsible for every heavily tweeted moment of confrontation. When Ferguson Police Chief Thomas Jackson first heard, for example, that two out-of-town reporters had been detained Wednesday, his immediate reaction was to say, "Oh, God."

"It's quite possible that it wasn't his officers that arrested the reporters," said Jim Bueermann, president of the Police Foundation, a think tank. "When you bring together a large number of officers from different agencies, command and control can be very confusing. This is a challenge for every police chief that I have spoken with."

If lines of authority got blurred among cops, the situation was arguably murkier among elected officials. Some local politicians and state legislators argued in favor of calm and order, but others were openly critical of the police response. "I approve their budget, so you know I'm pissed off," state Sen. Maria Chappelle-Nadal told a local news outlet.

She had tweeted obscene messages to Nixon, one of many to criticize the governor for his initial hands-off approach. Nixon had hoped the locals could sort things out, but it didn't work out that way.

A community activist tries to persuade protesters to move back as local police in riot gear watch Wednesday. (AP/Jeff Roberson)

Nixon and Johnson both got immediate rave reviews for putting away the riot gear. But if things had gone another way -- and Ferguson is far from yet being a bastion of peace and harmony -- the political fallout could have been immense. Long ago, California Gov. Pat Brown was blamed for destruction wrought by the 1965 Watts riots. Having become "the visible sign of authority," one of his biographer notes, "he was the governor who 'allowed' a great city to be devastated by hooligans." It was one big reason Brown lost his job in 1966 to Ronald Reagan.

Still, Nixon's actions have its critics. "It's shameful what [Nixon] did today," complained St. Louis County Prosecuting Attorney Robert McCulloch, in a rare expression of outrage. "He had no legal authority to do that. To denigrate the men and women of the county police department is shameful."

But Nixon announced Johnson's appointment with St. Louis Mayor Francis Slay and St. Louis County Executive Charlie Dooley at his side, presenting, at last, a united front from government. The sense that now there are grownups minding the store has helped bring about a new and much-needed atmosphere of calm in Ferguson.

Even before the shooting of Michael Brown last Saturday, local police had troubled relations with the community. Police forces that have engaged effectively with residents "will get a moment of pause" when an officer-involved shooting occurs, said Yale Law Professor Tracy Meares -- a chance for the chief to investigate and present his case. "When you've policed in a way that exacerbates distrust, then you don't get that," she said. "What you get is a riot."

Residents immediately sensed in Johnson -- an African American who has lived in the area -- a figure that they could deal with as they seek answers. His demeanor represented a stark shift from the approach taken by Ferguson police and their initial partners.

By Friday, even Ferguson Police Chief Jackson had got to hugging residents. But for days, in response to protesters chanting that the police had used excessive force, his department had used excessive force. "From the community perspective, it's the opposite message from what they would hope to send, that the police department is open, transparent and connected to the community and its desires," Buerrmann said.

Ferguson highlighted the problems that can occur when police are perceived to have little legitimacy, Meares said. Much of the media coverage of events there have focused on scary hardware and the so-called militarization of local police, but what needs to be addressed are questions of race and class and what expectations are from law enforcement in communities where life can already be a daily struggle.

Strong and clear leadership is needed not only when a crisis occurs, but on an ongoing basis to prevent distrust. "It's people in poor areas who most fervently want policing -- but not any kind of policing," Buerrmann said. "They want policing that treats everybody with respect."