WASHINGTON (AP) — President Trump on Wednesday will bring a message aimed at national unity and healing to the sites of the mass shootings in El Paso and Dayton. But the words he offers for a divided America will be complicated by his own incendiary, anti-immigrant rhetoric that mirrors language linked to one of the shooters.

It is a highly unusual predicament for an American president to at once try to console a community and a nation at the same time he is being criticized as contributing to a combustible climate that can spawn violence.

White House officials said Trump's visits to Texas and Ohio, where 31 people were killed and dozens wounded, would be similar to those he's paid to grieving communities including Parkland, Fla., and Las Vegas, with the president and first lady saluting first responders and spending time with mourning families and survivors.

"What he wants to do is go to these communities and grieve with them, pray with them, offer condolences," said White House spokesman Hogan Gidley. He said Trump also wants "to have a conversation" about ways to head off future deadly episodes.

"We can do something impactful to prevent this from ever happening again, if we come together," the spokesman said.

That's a tough assignment for a president who thrives on division and whose aides say he views discord and unease about cultural, economic and demographic changes as key to his reelection.

At the same time, prominent Democrats have been casting blame on Trump more often than calling for national unity in the aftermath of the shootings, a measure of the profound polarization in the country.

Trump, who often seems most comfortable on rally stages with deeply partisan crowds, has not excelled at projecting empathy, mixing what can sound like perfunctory expressions of grief with awkward offhand remarks. While he has offered hugs to tornado victims and spent time at the bedsides of shooting victims, he has yet to project the kind of emotion and vulnerability of his recent predecessors.

Barack Obama grew visibly shaken as he addressed the nation in the wake of the Sandy Hook elementary school massacre and teared up while delivering a 2016 speech on new gun control efforts. George W. Bush helped bring the country together following the Sept, 11 attacks, notably standing atop the smoking rubble of the World Trade Center, his arm draped over the shoulder of a firefighter, as he shouted through a bullhorn. Bill Clinton helped reassure the nation after the bombing of a federal building in Oklahoma City and the mass school shooting at Columbine High School.

Trump, too, has been able to summon soothing words. But then 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, though all are citizens, and describing majority-black Baltimore as a rat-infested hell-hole.

In the Texas border city of El Paso , some residents and local Democratic lawmakers said Trump was not welcome and urged him to stay away.

"This president, who helped create the hatred that made Saturday's tragedy possible, should not come to El Paso," tweeted Democratic presidential candidate Beto O'Rourke, who served the area for three terms as a congressman. "We do not need more division. We need to heal. He has no place here."

In Dayton, Mayor Nan Whaley said she would be meeting with Trump Wednesday, but she told reporters she was disappointed with his scripted remarks Monday responding to the shootings. His speech included a denunciation of "racism, bigotry and white supremacy" and a declaration that "hate has no place in America." But he made no mention of new efforts to limit sales of certain guns or the anti-immigration rhetoric found in an online screed posted just before the El Paso attack.

The hateful manifesto's author — police believe it was the shooter but investigation continues — insisted the opinions "predate Trump and his campaign for president." But the words echoed some of the views Trump has expressed on immigration, including claiming that Democrats "intend to use open borders, free HealthCare for illegals, citizenship and more to enact a political coup by importing and then legalizing millions of new voters."

Whaley said simply, "Everyone has it in their power to be a force to bring people together, and everybody has it in their power to be a force to bring people apart — that's up to the president of the United States."

Democrats vying to challenge Trump in the 2020 election have been nearly unanimous in excoriating him for rhetoric they warned has nurtured the racist attitudes of the El Paso shooter as they sought to project leadership during a fraught moment for a bruised nation.

New Jersey Sen. Cory Booker was delivering a speech on gun violence and white nationalism Wednesday at the Charleston, S.C., church where nine black parishioners were killed in 2015. Pete Buttigieg, the mayor of South Bend, Ind., released a detailed plan for gun control and deterrence.

Gidley and other White House officials denounced suggestions that Trump's rhetoric was in any way responsible for the shooting. They called it "dangerous," ''pathetic," ''disgusting."

"It's not the politician's fault when somebody acts out their evil intention," he said, pointing to other shooters who have expressed political preferences for Democratic politicians including Massachusetts Sen. Elizabeth Warren and Vermont's Bernie Sanders.

"It is shameful that Democrats are unable to prevent themselves from politicizing a moment of national grief," added Trump campaign spokesman Tim Murtaugh.

Trump himself, quoting one of the hosts of his favorite "Fox & Friends" show, tweeted: "Did George Bush ever condemn President Obama after Sandy Hook. President Obama had 32 mass shootings during his reign. Not many people said Obama is out of control. Mass shootings were happening before the president even thought about running for Pres."

Warren spokeswoman Kristen Orthman said leaders have an obligation to speak out.

"Let's be clear," she said in a statement. "There is a direct line between the president's rhetoric and the stated motivations of the El Paso shooter."

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

------

Associated Press writers Elana Schor, Deb Riechmann and Darlene Superville and AP polling editor Emily Swanson contributed to this report.

------

Follow Colvin on Twitter at https://twitter.com/colvinj