A man accused of spraying bear repellent into a crowd of protesters critical of President Trump over the weekend has been charged in the attacks, officials said Wednesday.

David Dempsey, 32, of Sherman Oaks, Calif., pleaded not guilty Tuesday to a felony count of the use of tear gas and a misdemeanor count of unlawful tear gas activity, the Los Angeles County District Attorney's Office said.

Dempsey allegedly showed up at a Saturday rally on the Santa Monica Pier with a group of counterprotesters waving American flags and "Make America Great Again" caps. A group known as Refuse Fascism was at the pier to protest against Trump as part of a movement called #OutNow!, according to The Los Angeles Times.

David Dempsey, 32, pleaded not guilty to charges connected to an attack on anti-Trump protesters in Southern California. 

David Dempsey, 32, pleaded not guilty to charges connected to an attack on anti-Trump protesters in Southern California.  (Santa Monica Police Department  )

Both groups exchanged words and taunts before a scuffle broke out. A video posted online shows a man wearing a MAGA hat circling the crowd and then unleashing a torrent of spray from a canister.

Several protesters and bystanders were hit. Dempsey was identified by Santa Monica police as the attacker and arrested at the scene.

CLICK HERE TO GET THE FOX NEWS APP

He has previous convictions for second-degree burglary, conspiracy to commit commercial burglary and fleeing a pursuing peace officer’s motor vehicle while driving recklessly, the district attorney said. He is being held on a $50,000 bond.

He is to appear in court Nov. 5.

The Associated Press contributed to this report.