Joshua Cobin (pictured), 29, was arrested for aggravated assault against police

Authorities in Arizona say they have arrested a man who was filmed being shot in the groin with a rubber bullet during an anti-Donald Trump protest this week after he allegedly kicked a tear gas canister at officers.

Phoenix law enforcement officials say that 29-year-old Joshua Cobin was placed under arrest after being charged on three counts of aggravated assault on police and one count of unlawful assembly.

Protests turned into skirmishes with police in Phoenix on Tuesday, as authorities attempted to disperse crowds gathered outside his rally with tear gas.

In one wince-inducing moment screened on CBS5 and captured on Twitter, Cobin - clad in a gas mask - kicked a canister of tear gas back at police.

Scroll down for video

Anti-Trump protester Joshua Cobi was filmed kicking a tear gas canister towards police after a Trump rally in Phoenix on Tuesday

Newsreaders said he had been hit by a rubber bullet as he collapsed in agony, and was later helped to his feet and taken away by a friend

Police officials say Cobin admitted to the incident on social media before his arrest and posted pictures of it online

Seconds later a cloud of dust mushroomed up from his groin and he doubled up in agony.

'A guy just got shot with a rubber bullet,' remarked one host, as the other lapsed into a pained silence. It has since emerged the man was hit with a tear gas canister.

'So... er... yeah, the officers are not, are not messing around at all,' the host stuttered as the stricken protester was dragged away by an ally.

Police officials say Cobin admitted to the incident on social media before his arrest and posted pictures of it online.

In a Facebook post he wrote: 'Thanks for all the kind words, what a crazy night last night! My hand feels a lot better..and for EVERYONE who asked, my nuts are fine lol, the cops missed by a few inches so I have a nasty baseball size bruise there.'

Protester kicks tear gas back at police. Police shoot him with a rubber bullet on live TV. VIDEO: pic.twitter.com/5qyHDZlpNF — Tim Ring (@timringTV) August 23, 2017

Cobin was placed under arrest after being charged on three counts of aggravated assault on police and one count of unlawful assembly

Arrested: Cobin is pictured in a Twitter photo protesting about Trump

The violent scenes came after police tried to disperse crowds of anti-Trump protesters with tear gas following the rally. The anti-Trump crowd were vastly outnumbered by Trump fans

Police fired pepper spray to disperse protesters outside a rally by U.S. President Donald Trump in Phoenix, Arizona

Cobin, according to a police report, was 'generally unruly and clearly refusing to disperse and refusing to do so in an unlawful manner.'

Police also claim Cobin was 'engaging in conduct constituting a riot' before he was caught on security cameras kicking a smoking canister toward the line of officers.

He was just one of many caught up in the post-rally violence, as cops used nonlethal methods to disperse crowds who had thrown rocks and bottles at them.

Police have not given an estimate of the number of protesters, but Arizona media said there were several thousand

Four people were arrested during the protest, Phoenix Police Chief Jeri Williams later said during a news conference

The unrest broke out after Trump swung through the city for a rally designed to fire up his base - which it did, his fans vastly outnumbering anti-Trump protesters.

Supporters and opponents alike gathered in the 107-degree heat, but it was only after the rally that violence broke out.

Police say that protesters threw water bottles and rocks at their lines, causing them to respond in kind with tear gas, pepper spray, rubber bullets and pepper balls.

Clouds of the gas filled the night air as the president's supporters began leaving the downtown Phoenix Convention Center.

At around 11.20pm, Phoenix Police Chief Jeri Williams said that three people had been arrested on charges related to the protest.

She added that one person was arrested on an unrelated warrant, and that two officers were treated for heat exhaustion.

Police say that protesters threw water bottles and rocks at their lines, causing them to respond in kind with tear gas

A contingent of protesters stayed behind after the clash with police had ended. Their numbers were small.

Trump beat Hillary Clinton in Nevada by a tenuous 3.5 percentage points last year, and is now polling 7 points lower there than his election total.

So his visit on Tuesday was apparently an attempt to boost that falling number.