PHOENIX -- (KNXV) -- Phoenix police say they’ve arrested a man who allegedly kicked a can of tear gas at officers after the President Trump rally earlier this week. Police shot the man with a pepper ball moments after he kicked the canister.

Police say 29-year-old Joshua Cobin has been arrested on three counts of aggravated assault on police and one count of unlawful assembly.

Police say Cobin had posted photos and admitted to the incident on social media before he was located and arrested.

According to police paperwork, Cobin was seen running back and forth in front of the police line after officers told the crowd to disperse. He was "generally unruly and clearly refusing to disperse and refusing to do so in an unlawful manner," the documents say.

Cobin and two other people were described as "engaging in conduct constituting a riot" before he was caught on security cameras kicking a smoking canister toward the line of officers. He was then recorded throwing that same canister and another smoking canister at the officers.

Police say after the repeated throws, they fired an "impact OC round" to stop his assaults.

A judge was seen in Cobin's initial appearance video saying she was going to release him due to his steady job and no prior criminal history. She also urged caution with his social media posts.