Police have fired tear gas and stun grenades at crowds of protesters in Phoenix, Arizona, as they demonstrated against US President Donald Trump, who held a campaign-style rally nearby for supporters.

A haze enveloped the night sky on Tuesday as protesters and police clashed outside the downtown Phoenix Convention Center, where Trump had just wrapped up his speech.

People fled coughing as an officer in a helicopter above bellowed through a speaker, urging protesters to leave the area.

Police claimed protesters threw rocks and bottles at shielded officers, who were armed with batons.

"They also dispersed some gas in the area," said Jonathan Howard, Phoenix police spokesman.

The officers responded with pepper spray to "disperse the crowd and stop the assaults," he said.

Three people were arrested, Police Chief Jeri Williams said.

READ MORE: In quotes - Trump's campaign-style rally in Phoenix

However, several people on social media disputed the police account.

"I witnessed no gas being thrown at police prior to police firing upon protesters," reporter Andrew Kimmel said, writing on Twitter.

Local television station 3TV showed footage of police shooting an object at a protester who had kicked back a tear gas canister. The protester fell to the ground after being hit.

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

Not tear gas that police are firing to disburse Trump protests, it's pepper balls. Here's a shell that landed near me. pic.twitter.com/wJUzb5WI5J — Roque Planas (@RoqPlanas) August 23, 2017

Police did not estimate how many protesters had gathered, but Arizona media said thousands turned out.

Authorities were on high alert for the gathering - the president's first political rally since deadly violence in Charlottesville, Virginia. There, on August 12, a white supremacist mowed down anti-racist protesters who were countering a far-right rally, killing 32-year-old Heather Heyer and injuring dozens.

'Toxic Trump'

Al Jazeera's Gabriel Elizondo, reporting from Phoenix, described tense scenes as skirmishes broke out between protesters and Trump supporters at the end of the president's campaign-style rally.

"There were some scuffles, instances of people yelling back and forth at each other. Then, as the anti-Trump group started to break up, police used tear gas to disperse the crowds and open up the streets," he said.

"Most of that tension has now left the streets. However, there continues to be a heavy riot police presence here."

Phoenix Mayor Greg Stanton had unsuccessfully called on the president to not hold the rally so soon after the trouble in Charlottesville.

READ MORE: Campuses, cities reject far right after Charlottesville

A few scuffles and shouting matches were also reported earlier in the day as Trump supporters lined up to attend the rally. But those events were generally peaceful.

"Toxic Trump," read one protest sign held up to the president's supporters streaming into the Phoenix Convention Center downtown.

"Lock Him Up!" read another, a reference to earlier campaign chants by Trump and his backers about his Democratic election rival Hillary Clinton.

And the pronoun has turned: "Lock him up" chants ring in Phoenix pic.twitter.com/309AH14xGR — Vaughn Hillyard (@VaughnHillyard) August 23, 2017

About six members of an anti-Trump group, Redneck Revolt, arrived with guns. John Brown, who wore military fatigues and carried an AK-47, said he was there to protect anti-Trump protesters.

Arizona allows people to carry weapons openly.

Dillon Scott of Phoenix, who voted for Clinton, said he came out to express dissatisfaction with how long Trump took to denounce racism after the Charlottesville violence.

"No one should be allowed to get away with what he gets away with, especially in political office," Scott said.

A number of opposition signs showed drawings or photos of Trump with a small, Hitler-style moustache.

Three Trump supporters taunted Latino protesters with offensive comments about immigrants and held anti-Muslim and Black Lives Matter signs.

Diane Treon, who queued up before dawn for the 7pm rally, said protests had kept her away from Trump's rallies previously.

She told the Associated Press news agency she wished protesters "would be a little more peaceful instead of violently rioting", but was not overly worried about violence.