The violence that turns a small-town protest into a fiery national spectacle like the one that has played out this month in Missouri is often unwittingly provoked by police, according to researchers at UC Berkeley.

The research team, which studied clashes between police and activists during the Occupy movement three years ago, found that protests tend to turn violent when officers use aggressive tactics, such as approaching demonstrators in riot gear or lining up in military-like formations.

Recent events in Ferguson, Mo., are a good example, the study's lead researcher said. For nearly two weeks, activists angered by a white police officer's fatal shooting of an unarmed black teenager have ratcheted up their protests when confronted by heavily armed police forces.

"Everything starts to turn bad when you see a police officer come out of an SUV and he's carrying an AR-15," said Nick Adams, a sociologist and fellow at UC Berkeley's Institute for Data Science who leads the Deciding Force Project. "It just upsets the crowd."

Adams said many law enforcement agencies aren't aware that they set the tone of a protest and end up inflaming it.

192 cities studied

His team reached its conclusions by analyzing Occupy protests in 192 U.S. cities in 2011. The researchers sifted through thousands of news reports about the protests, which were sparked by concerns over economic inequality, and isolated patterns of violence and their apparent causes.

Some of the most contentious Occupy protests happened in Oakland, where the fallout is still being scrutinized.

In one October 2011 protest over the clearing of an Occupy encampment outside Oakland City Hall, officers fired tear gas and projectiles into crowds, injuring several activists. One of them, Iraq war veteran Scott Olsen, was critically hurt and settled a lawsuit against the city in March for $4.5 million.

Oakland police later tried to address concerns about heavy-handed tactics, seeking to head off unruly protests with early crowd-control measures such as issuing tickets for jaywalking.

But finding the appropriate balance between being too aggressive and not aggressive enough hasn't been easy.

Restraining looting

Oakland merchants and landowners who have seen their property looted during demonstrations have called for a stronger police response. And last year, police were criticized for not doing enough when a restaurant employee was attacked by a person wielding a hammer at a protest over George Zimmerman's acquittal in the fatal shooting of Florida teenager Trayvon Martin.

Adams said Oakland police put themselves in a difficult situation early on because their actions damaged relations with demonstrators.

"Once police departments come out with overwhelming force, they put themselves in a hole," he said. "It may work out in the end, but they're going to be sidelined until that trust is earned again."

This week's protests in Oakland, to show solidarity with Ferguson activists, have been peaceful. Officers have restricted where marches can take place but have kept their distance.

Oakland police officials declined to be interviewed for this story.

Some bent on trouble

Tony Ribera, San Francisco police chief from 1992 to 1996, said there's little doubt that officers' actions can determine how protesters react. However, he said, large demonstrations draw agitators who are there solely to cause trouble, regardless of what police do.

He said law enforcement agencies are usually most successful at handling demonstrations when they approach with a nonconfrontational stance and ramp up when necessary.

"It's hard to have a confrontational situation, then pull back from that," said Ribera, who now heads the International Institute of Criminal Justice Leadership at the University of San Francisco.

Large police departments know this, Ribera said, and train their officers accordingly.

In San Francisco, officials say they try to use force sparingly.

"We don't use tear gas. We don't use rubber bullets or dowels in crowd control," said police spokesman Officer Albie Esparza. "San Francisco is a professional protest city. We have protests here all the time. Our department is well versed in facilitating First Amendment rights."

Calming tactics

The UC Berkeley researchers found that some law enforcement agencies are taking less provocative measures.

During the Occupy protests, for example, police in some cities deployed officers in small clusters rather than in skirmish lines. Such cities tended to see fewer clashes between demonstrators and police, the researchers said.

"When it's two or three officers, protesters don't get intimidated," Adams said. "They may even talk with the police."

That hasn't always been the case in Ferguson, where protesters have taken to the street nightly since the Aug. 9 shooting of 18-year-old Michael Brown by police Officer Darren Wilson. On several occasions, crowds have clashed with officers, who have responded with tear gas. As of Thursday, 163 people had been arrested in the protests, according to the Associated Press.

Adams' team is still evaluating its findings and is incorporating other factors to determine whether they influence crowd behavior, including city rules for holding protests, an area's political makeup and local demographics. They expect to publish their findings by the end of the year.

Kurtis Alexander is a San Francisco Chronicle staff writer. E-mail: kalexander@sfchronicle.com Twitter: @kurtisalexander San Francisco Chronicle staff writer Vivian Ho contributed to this report.