CLAYTON, Mo. - Police charged a man from the St. Louis area with shooting two officers during a protest last week in Ferguson, and said the alleged gunman had attended the protest earlier in the night.

Jeffrey Williams, 20, was arrested late Saturday and charged with two counts of first-degree assault. The top prosecutor in St. Louis County, Robert McCulloch, said police relied on tips from the public to identify Williams. He said Williams had admitted firing the shots that struck the officers outside Ferguson police headquarters.

McCulloch said that Williams "is a demonstrator" and that he had so attended other protests in Ferguson, althoug.h he did not say how many.

That assertion, if proved true, could have a significant impact on Ferguson and its demonstrators, whose leaders have stressed a commitment to nonviolent methods.

On Sunday, several protest leaders said Williams had not been a familiar face at demonstrations. Several said they had never seen him at all.

"He's certainly not a regular," said Tony Rice, who has been the primary organizer of the protests outside of the Ferguson police building since August. "I've never seen that guy before."

McCulloch, the prosecutor, said that Williams had also told investigators that, when he fired the gun, he was not aiming at the officers in the distance.

"He may have had a dispute with some other individuals, or felt some dispute. We're not sure we completely buy that part of it," McCulloch said. "However, it's still an assault in the first degree."

One protest leader, Derrick Robinson, said in an interview Sunday that Williams had told him that he was being robbed at the time of the shooting and that he shot into the air in response. "He was in great remorse and said he wishes he could replay it and do it differently," said Robinson, who visited Williams in jail Sunday.

Robinson, a minister at Kingdom Dominion International Church in Belleville, Ill., said he had seen Williams once before, at a church event, but visited him after his name was announced by police. He said Williams had walked past the protest Wednesday but had not been a demonstrator.

He said the 20-year-old had bruises that Williams told him came at the hands of officers. A spokesman for St. Louis County police said that was untrue.

The protests in Ferguson began last summer, when a white Ferguson police officer shot and killed Michael Brown, an unarmed black 18-year-old. A grand jury declined to indict the officer, Darren Wilson.

Brown's death was a catalyst for huge demonstrations against what was seen as excessive use of police force and tactics that unfairly targeted African American residents. Police responded with trained rifles and military gear, a reaction that galvanized the country and, to many activists, proved the point. For many local activists, the key to keeping their moral authority was to channel anger at the police into forceful, but peaceful, demonstrations.

But, at times, those demonstrations have drawn a fringe of others whose only purpose is confrontation: to lash back, verbally or physically, at the officers they found in Ferguson. That group was in evidence Wednesday in the hours before the shooting; police reported hearing unusually vulgar, angry taunts from a minority of the demonstrators.

At the time of the shooting, McCulloch said, Williams already had a warrant out for his arrest. He was on probation for receiving stolen property and had not checked in with his probation officer in seven months.

Williams was in jail Sunday on $300,000 bond.

In a statement after the arrest, Attorney General Eric Holder Jr. said that federal ballistics tests had helped link Williams to the crime. "This arrest sends a clear message that acts of violence against our law enforcement personnel will never be tolerated," Holder said in a statement.

In recent weeks, small measures of change had begun to appear in Ferguson.

In the days between the shooting and Williams' arrest, the crime left each side of Ferguson's divide more mistrustful of the other.