PHOENIX — Urged by supporters and critics alike to use his speech here Tuesday to help heal the wounds of racial division stemming from the violence that erupted at a white supremacist rally in Charlotesville, Va., earlier this month, a defiant President Trump wound up doing nearly the opposite.

After defending his much-derided, evolving response to the tragic events in Virginia, Trump spent more than 20 minutes attacking the media as “really bad people” who “foment divisions” because they “don’t like our country.” He disparaged both of Arizona’s Republican senators, John McCain and Jeff Flake, though not by name: McCain for casting the “one vote” that killed Obamacare repeal and Flake for being “weak on borders and weak on crime.” And he all but promised to pardon anti-immigrant icon Joe Arpaio, the hard-line former Maricopa County sheriff whose round-’em-up raids have landed him in legal trouble.

“I’ll make a prediction — I think he is going to be just fine,” Trump told the thousands of supporters in red “Make America Great Again” hats who’d crowded into the cavernous Phoenix Convention Center, where they hung on his every word.

“I won’t do it tonight because I don’t want to cause any controversy,” Trump explained. “But Sheriff Joe can feel good.”

Ten days after a “Unite the Right” rally in Charlottesville ended with a white supremacist driving a Dodge Challenger into a crowd of counterprotesters, injuring 19 and killing one — and with tensions still running high after a week of equivocal responses that provoked widespread criticism of the president from both Democrats and Republicans — White House staffers clearly wanted to hit the reset button in Phoenix.

President Trump speaks to supporters at the Phoenix Convention Center during a rally on Aug. 22. (Photo: Ralph Freso/Getty Images)

The other speakers on the program — Vice President Mike Pence, Dr. Ben Carson, Rev. Franklin Graham, and Dr. Alveda King, the niece of Martin Luther King, Jr. — emphasized unity and equality in their remarks, and the speech streaming across Trump’s teleprompter soberly spelled out the “pro-worker” agenda he wants Congress to pursue in the months ahead.

Story continues

But Trump refused to stick to the script. Over 75 combative minutes, Trump veered wildly from his prepared text as he tore into one enemy after another, real or perceived, and hammered on every hot-button topic he could think of.

Related slideshow: Trump rally in Phoenix draws protesters from both sides >>>

It was Charlottesville that seemed to set him off.

After reading a line about how “what happened in Charlottesville strikes at the core of America” and insisting that “this entire arena stands united in condemnation of the thugs who perpetrated violence,” Trump produced a computer printout from his pocket and proceeded to re-litigate — at length — last week’s back-and-forth with the press.

“Here’s what I said on Saturday,” he intoned, reading from the sheet of paper to prove that the “dishonest” media had not reported the whole truth. “We condemn in the strongest possible terms hatred, bigotry and violence.”

Trump then pointedly left out the part where he blamed this “hatred, bigotry and violence” on “many sides” — which is, of course, the part that set off a bipartisan firestorm in the first place.

A few minutes later, in an attempt to show that he had, in fact, called out the specific groups protesting in Charlottesville, Trump glibly told the crowd that, “I hit ’em with neo-Nazi, I hit ’em with everything. KKK? We have KKK. I got ’em all.”

“The only people giving a platform to these hate groups,” the president insisted, “is the media itself.”

From there, Trump only occasionally returned to his prepared remarks — which touched on his plans for border security, infrastructure and tax reform — choosing instead to complain about anti-fascist protesters outside the event (“they show up in black masks; they got clubs and everything”); the elites (“I went to better schools than they did and got better grades than they did, and I live in a bigger, better apartment then them too”); and even the presidency itself.

President Trump speaks in Phoenix on Aug. 22. (Photo: Nicholas Kamm/AFP/Getty Images)

“Most people think I’m crazy to have done this,” Trump said. “And I think they’re right.”

Trump’s performance in Phoenix rivaled his most caustic moments on the 2016 campaign trail — and it emphasized how unwilling he still is, eight months into his tenure as leader of the free world, to “pivot” into a more presidential mode.

Just one night after preaching “there is no room for prejudice, no place for bigotry, and no tolerance for hate” in a televised address to the nation, the president openly mocked his advisers for asking him to maintain a similar tone Tuesday in Arizona.

“They all said, ‘Your speech was so good last night — please Mr. President, don’t mention any names,’ Trump said. “So I will not mention any names! Very presidential.”

He then launched into a thinly veiled tirade against McCain and Flake.

At times of national discord, when the wounds of recent tragedies are still raw, American presidents tend to follow a familiar playbook. They visit the scene of the crime. They speak to the entire nation. And they deliver a message meant to heal — not hurt.

This is what President George W. Bush did on April 17, 2007, one day after a Virginia Tech senior shot and killed 32 people on campus; it’s what his successor, President Barack Obama, did on Jan. 12, 2011, four days after another young man shot Rep. Gabrielle Giffords and 18 others in Tucson, Ariz.

But it’s not what President Trump did in Phoenix.

Near the end of the evening, Trump glanced back at his teleprompter to read a passage that would have sounded presidential in another context — but that now seemed jarring in light of all the improvisational vitriol that had preceded it.

“I came to Washington for you,” he said. “Your dreams are my dreams, your hopes are my hopes, and your future is what I’m fighting for every day.”

If Trump wanted anyone beyond his base to believe those lines, he missed another opportunity Tuesday to show it.

Read more from Yahoo News: