Police have fired pepper spray to disperse rival protesters at US President Donald Trump's first public appearance after his widely criticised handling of deadly demonstrations in Charlottesville last week.

Key points: Donald Trump's rally in Arizona attracted large groups of protesters and police

Donald Trump's rally in Arizona attracted large groups of protesters and police President said after the deadly Charlottesville rally he condemned violence in the "strongest possible terms"

President said after the deadly Charlottesville rally he condemned violence in the "strongest possible terms" Mr Trump hinted he could pardon former sheriff convicted of targeting immigrants

Officers fired pepper balls and gas on the crowd, which was made up of Trump supporters and opponents, after rocks and bottles were thrown after the rally, police said.

Mr Trump used the rally to condemn the "thugs" involved in deadly white supremacist protests in Virginia last week, at which anti-racism campaigner Heather Heyer was killed, and he criticised media coverage of his "perfect" response to the tragedy.

"What happened in Charlottesville strikes at the core of America," he said.

"Tonight this entire arena stands united in forceful condemnation of the thugs who perpetrate hatred and violence."

Sorry, this video has expired Protesters rally against Donald Trump outside campaign venue (Image: AP/Matt York)

The President told the crowd he "openly called for unity, healing and love" and condemned violence in the "strongest possible terms", but the "very dishonest media" did not report those comments and instead made up other stories with "no sources".

"They don't report the facts. Just like they don't want to report that I spoke out forcefully against hatred, bigotry and violence and strongly condemned the Neo-Nazis, the white supremacists and the KKK," he said.

"The only people giving a platform to these hate groups is the media itself and the fake news."

Donald Trump supporters and protesters gathered outside his first public appearance since the Charlottesville demonstrations. ( AP: Matt York )

Mr Trump later accused the media of turning off cameras broadcasting his speech.

He then dissected his three previous public statements on the disturbance in Charlottesville, highlighting his comments about the man accused of killing Ms Heyer, extremist groups and calls for national unity against hate and racism.

Mr Trump then hailed the creation of more than 1 million jobs during his presidency, adding he thought they would have a "tremendously positive impact on race relations".

"We're showing compassion for the struggling American workers who are now starting to see the light because plants are coming back, pouring back into our country," he said.

"We want every American community to succeed, including our immigrant communities, but they can't do that if we don't control our borders."

Trump hints at possible pardon for convicted sheriff

The President used his speech to again tease about a possible pardon for Joe Arpaio, a former Arizona sheriff who is awaiting sentencing after his conviction in federal court for disobeying court orders to stop his traffic patrols that targeted immigrants.

Last week Mr Trump retweeted a news story speculating that he may extend a presidential pardon to 85-year-old Arpaio, who was Phoenix's top law enforcer for 24 years.

"Was Sheriff Joe convicted for doing his job?" Mr Trump asked the crowd, which produced a loud "yes" in response.

"He should have had a jury, but you know what? I will make a prediction — I think he is going to be just fine. OK?" the President replied.

"But I won't do it tonight because I don't want to cause any controversy.

"Sheriff Joe can feel good. The people of Arizona know the deadly and heartbreaking consequences of illegal immigration."

The White House had earlier foreshadowed there would not a pardon announcement at the event and Arpaio said: "They just decided not to do it tonight. We'll have to see if and when it occurs in the future."

Mr Trump also praised his administration's immigration policies, saying it was "liberating" communities of "drugs, gangs, cartels, [the] crisis of smuggling and trafficking" and cracking down on gang members by "throwing them in jail, throwing them out of the country".

There aren't too many people outside protesting: Trump

Sorry, this video has expired Protesters target Trump campaign in Phoenix

Before and after the speech, anti-Trump protesters engaged in minor scuffles and shouting matches with supporters of the President.

Phoenix Police Department spokesman Sergeant Jonathan Howard said some people in the crowd after the event began throwing rocks and bottles at police.

"Police have responded with pepper balls and OC (oleoresin capsicum) spray in an attempt to disperse the crowd and stop the assaults," he said.

Sorry, this video has expired Trump supporters turn out in Phoenix

Police have not given an estimate of the number of protesters who turned out for the event, but Arizona media said there were several thousand people.

But Mr Trump told the crowd early in his speech: "And just so you know from the secret service, there aren't too many people outside protesting, OK?"

Phoenix Mayor Greg Stanton had called on the President to not hold the rally in the city so soon after the trouble in Charlottesville but Trump fans wearing red "Make America Great Again" hats waited in line hours before the event.

The Donald Trump rally was held under tight security. ( Reuters: Sandy Huffaker )

AP