U.S. President Donald Trump gave a long campaign-style speech peppered with many off-script moments to a crowd of admirers in Phoenix, Ariz., Tuesday night.

Trump touched on many familiar themes, such as the "sick people" in the media, offered a tireless defence of his reaction to violence at a white nationalist rally and said that the U.S. may end up "terminating" the North American Free Trade Agreement.

Trump opened his campaign rally with a call for unity, saying, "What happened in Charlottesville strikes at the core of America and tonight, this entire arena stands united in forceful condemnation of the thugs that perpetrated hatred and violence."

But he quickly trained his ire on the media, shouting that he "openly called for healing unity and love" in the immediate aftermath of Charlottesville and claiming the media had misrepresented him. He read from his three responses to the violence — getting more animated with each one.

U.S. president speaks at rally in Arizona, clarifies remarks he made in the wake of violence in Charlottesville, Va. 1:12

The president unabashedly acknowledged that his own advisers had urged him to stay on message, and that he simply could not.

At times going off-script for a long duration, Trump said he thinks the U.S. will "end up probably terminating" the North American Free Trade Agreement with Canada and Mexico "at some point."

"Personally, I don't think we can make a deal because we have been so badly taken advantage of," he commented.

Trump: 'We'll end up probably terminating NAFTA' 0:37

Then he turned back, and cautioned he has yet to make up his mind.

He also took the opportunity to reiterate his current position — markedly different from past opinions expressed during television appearances — that Confederate monuments should not be moved or deconstructed.

Trump said that local officials who support removal are "weak" people who are "trying to take away our history and our heritage."

[S IMILAR]

'He's going to be just fine'

Earlier this week, Trump had teased the politically inflammatory possibility of pardoning former sheriff Joe Arpaio while in Arizona. The former Maricopa County sheriff is awaiting sentencing after his conviction in federal court for disobeying court orders to stop his immigration patrols.

The president told the rally audience that while he wouldn't pardon the sheriff tonight, he hinted that he will ultimately pardon the divisive Arpaio.

Trump said he would not pardon the convicted former sheriff of Mericopa County, Ariz., Joe Arpaio on Tuesday night because he didn't want to cause controversy. He then said Arpaio is "going to be just fine" as the crowd roared. (Joshua Roberts/Reuters)

"So was Sheriff Joe convicted for doing his job?" Trump asked. "I'll make a prediction: I think he's going to be just fine."

After the rally, a day of noisy but largely peaceful protests outside the Phoenix convention centre turned unruly as police fired pepper spray at crowds after someone apparently lobbed rocks and bottles at officers.

Phoenix police said early Wednesday that four people were arrested on charges related to the protest.

Both Arizona senators avoid rally

In the comfort of his most fervent fans, Trump often resurrected his free-wheeling 2016 campaign style, pinging insults at perceived enemies such as the media and meandering from topic to topic without a clear theme.

He skewered both of Arizona's Republican senators, both of whom did not appear at the rally, but coyly refused to mention their names, describing his own restraint as "very presidential."

Trump's wall promise is very important to many of his most passionate supporters. (Reuters)

Instead, Trump bemoaned that the Senate was only "one vote away" from passing a health care overhaul. Sen. John McCain, who is undergoing treatment for an aggressive form of brain cancer, voted against a Republican health care bill.

Trump called another unnamed senator "weak on borders, weak on crime." Trump has lashed out at Sen. Jeff Flake, a frequent critic, using the same language in the past. The president tweeted last week: "Great to see that Dr. Kelli Ward is running against Flake, who is WEAK on borders, crime and a non-factor in Senate. He's toxic!"

Flake has been on tour promoting his book that says the Republican Party's embrace of Trump has left conservatism withering.

In a modest but telling swipe at Ward and, by extension, at Trump, the Senate Leadership Fund, a political committee closely aligned with Senate Majority Leader Mitch McConnell of Kentucky, is spending $10,000 on digital ads that say of her, "Not conservative, just crazy ideas."

Police used pepper spray to disperse a crowd of anti-Trump protesters that gathered outside the convention centre where the president was delivering his campaign speech for the 2020 election. (Sandy Huffaker/Reuters)

During the rally, Trump surprised both Republicans and Democrats when he threatened to shut down the U.S. federal government if his so-called border wall isn't built.

'We're adrift morally'

Trump spoke after Vice-President Mike Pence and others called repeatedly for unity.

Housing Secretary Ben Carson and Dr. Alveda King, the niece of civil rights activist Martin Luther King Jr., were among the openers.

Franklin Graham, son of the evangelist Billy Graham, led the rally-goers in prayer, saying, "We're divided racially, and we're adrift morally."

Outside the Phoenix convention centre, shouting matches and minor scuffles erupted between Trump supporters and protesters gathered near the site.

Phoenix Mayor Greg Stanton had asked Trump to delay his political event to allow for more time of national healing after Charlottesville, but the White House did not formally respond.