President Donald Trump and first lady Melania Trump arrive at El Paso International Airport to meet with people affected by the El Paso mass shooting, Wednesday, Aug. 7, 2019, in El Paso, Texas. (AP Photo/Evan Vucci)

EL PASO, Texas (AP) — Aiming to play the traditional role of healer during national tragedy, President Donald Trump paid visits Wednesday to two cities reeling from mass shootings that left 31 dead and dozens more wounded. But his divisive words preceded him, large protests greeted him and biting political attacks soon followed.

The president and first lady Melania Trump flew to El Paso late in the day after visiting the Dayton hospital where many of the victims of Sunday’s attack in that city were treated. The president was kept out of view of the reporters traveling with him, but White House Press Secretary Stephanie Grisham said the couple met with hospital staff and first responders and spent time with wounded survivors and their families.

Trump told them he was “with them,” she said. “Everybody received him very warmly. Everybody was very, very excited to see him.”

But outside Miami Valley Hospital, at least 200 protesters gathered, blaming Trump’s incendiary rhetoric for inflaming political and racial tensions in the country and demanding action on gun control . Some said Trump was not welcome in their city. There were Trump supporters, as well.

Emotions are still raw in the aftermath of the early Sunday morning shooting rampage that left 10 dead, including the gunman, in the city’s popular Oregon entertainment district. Critics contend Trump’s own words have contributed to a combustible climate that has spawned violence in cities including El Paso, where another shooter killed 22 people over the weekend.

And the vitriol continued Wednesday. Trump spent part of his flight between Ohio and Texas airing his grievances on Twitter, berating Democratic lawmakers, a potential 2020 rival and the press. It was a remarkable split=screen appearance for TV viewers, with White House images of handshakes and selfies juxtaposed with angry tweets.

Trump and the White House have forcefully disputed the idea that he bears some responsibility for the nation’s divisions. And Trump continued to do so as he left for the trip on Wednesday.

“My critics are political people,” Trump said, noting the apparent political leanings of the shooter in the Dayton killings. He also defended his rhetoric on issues including immigration, claiming instead that he “brings people together.”

Some 85% of U.S. adults believe the tone and nature of political debate has become more negative, with a majority saying Trump has changed things for the worse, according to recent Pew Research Center polling. And more than three quarters, 78%, say that elected officials who use heated or aggressive language to talk about certain people or groups make violence against those people more likely.

In Dayton, raw anger and pain were on display as protesters chanted “Ban those guns” and “Do something!” during Trump’s visit.

Holding a sign that said “Not Welcome Here,” Lynnell Graham said she thinks Trump’s response to the shootings has been insincere.

“To me he comes off as fake,” she said.

Dorothee Bouquet, stood in the bright sun with her 5-year-old daughter and 2-year-old son, tucked in a stroller. She told them they were going to a protest “to tell grownups to make better rules.”

But in El Paso, where more protests awaited, Raul Melendez, whose father-in-law, David Johnson, was killed in Saturday’s shooting, said the most appropriate thing Trump could do was to meet with relatives of the victims.

“It shows that he actually cares, if he talks to individual families,” said Melendez, who credits Johnson with helping his 9-year-old daughter survive the attack by pushing her under a counter. Melendez, an Army veteran and the son of Mexican immigrants, said he holds only the shooter responsible for the attack.

“That person had the intent to hurt people, he already had it,” he said. “No one’s words would have triggered that.”

Local Democratic lawmakers who’d expressed concern about the visit said Trump had nonetheless hit the right notes Wednesday.

“He was comforting. He did the right things and Melania did the right things. It’s his job to comfort people,” said Sen. Sherrod Brown, who nonetheless said he was “very concerned about a president that divides in his rhetoric and plays to race in his rhetoric.”

“I think the victims and the first responders were grateful that the president of the United States came to Dayton,” added Mayor Nan Whaley, who said she was glad Trump had not stopped at the site of the shooting.

“A lot of the time his talk can be very divisive, and that’s the last thing we need in Dayton,” she said.

Grisham, responding on Twitter from aboard Air Force One, sad it was “genuinely sad” to see the lawmakers “immediately hold such a dishonest press conference in the name of partisan politics.”

The discord continued in El Paso. Rep. Veronica Escobar, the Democratic congresswoman who represents the city, declined to meet with Trump. “I refuse to be a prop,” she said in an interview on CNN.

Visits to the sites of mass shootings have become a regular pilgrimage for recent president, but Trump, who has sometimes struggled to project empathy during moments of national tragedy, has stirred unusual backlash.

Though he has been able to summon soothing words and connect one-on-one with victims, he often quickly lapses into divisive tweets and statements — just recently painting immigrants as “invaders,” suggesting four Democratic congresswoman of color should “go back” to their home countries even though they’re U.S. citizens and deriding majority-black Baltimore as a rat-infested hell-hole.

Even on the eve of his trip, Trump was lashing out at a potential 2020 rival, former Rep. Beto O’Rourke, who had tweeted that Trump “helped create the hatred that made Saturday’s tragedy possible” and “should not come to El Paso.”

O’Rourke “should respect the victims & law enforcement – & be quiet!” Trump snapped back.

And on his flight between one scene of tragedy and the second, Trump said he turned in as another 2020 rival, former Vice President Joe Biden, excoriated him in a speech that slammed him as incapable of offering the moral leadership that has defined the presidency for generations and “fueling a literal carnage” in America.

Trump declared the speech “Sooo Boring!” and warned that, “The LameStream Media will die in the ratings and clicks” if Biden wins.