WASHINGTON — In looking to place blame for this weekend's mass shootings, President Donald Trump may have inadvertently pointed at himself.

In an early morning tweet thread about the shooting massacres in El Paso, Texas, and Dayton, Ohio, over the weekend, Trump offered up a legislative solution that included "desperately needed immigration reform."

Later, during remarks delivered emotionlessly from a podium at the White House, Trump identified the internet, video games, mental illness and racism as culprits in the murder sprees.

"Mental illness and hatred pulls the trigger, not the gun," he said.

Whether Trump realizes it or not, his observations came across to some as tragic self-owns.

Trump held tight to a political base that demands allegiance to the promises he's made to defend gun owners' rights and advance a border policy that is infused with racist rhetoric. Rather than risk alienating his allies, Trump chose to expose himself to claims of responsibility — "hatred pulls the trigger," said the president who hurls invective at his adversaries — and to reminders that he hopes to accomplish with immigration policy what the alleged shooter could not get done with bullets.

Hatred is his political weapon of choice — he called critics of Supreme Court Justice Brett Kavanaugh "really evil people," said that white supremacists are "very fine people" and branded the news media the "enemy of the people" — and his is the face of policies cracking down on Hispanic immigrants.

"Only a racist, driven by fear, could witness what took place this weekend — and instead of standing up to hatred, side with a mass murderer's call to make our country more white," Democratic presidential candidate Beto O'Rourke said on Twitter.

An online manifesto that authorities believe is linked to the suspect in the El Paso rampage attributed the motive to repelling a Hispanic "invasion," echoing language that Trump has incessantly used to demonize and dehumanize Latinos and whip up support for his crackdown on undocumented immigrants.

And Trump, who has openly mused about walking down Fifth Avenue in New York shooting people and who laughed when a supporter at a rally shouted that immigrants coming over the border should be shot, has spent much of the last month engaged in racist diatribes against nonwhite members of Congress.

While Trump nodded to background checks for gun buyers in his tweet earlier in the day and his administration did ban the bump stocks that allow semi-automatic weapons to be used in more automatic-like fashion, he has declined to consider popular "universal" background-check proposals that would require such legwork on purchases at gun shows and in private transactions, or to even discuss bans on particular weapons or clips.

In 2017, he signed a law nullifying an Obama-era regulation designed to add certain people with mental illnesses to the national background-check database.

With a script in front of him on Monday, Trump denounced prejudice and other societal ills and called for unity.

"Open wounds cannot heal if we are divided," he said.

The tone was markedly different from campaign rallies at which Trump delights in derisive chants like he did earlier this month by stepping back to take in a crowd's "send her back" homage to one of his racist tweets. It was similarly in contrast to the vibe of a Twitter feed on which he frequently rips into lawmakers of color, including "the squad," Rep. Elijah Cummings, D-Md., and Rep. Maxine Waters, D-Calif.

That's because in a divided country, where Americans get their news from self-selected sources, Trump can alter his message depending on the audience, said Victoria DeFrancesco Soto, a professor and the director of civic engagement at the LBJ School of Public Affairs at the University of Texas in Austin.

"He’s trying to have it both ways so that he can speak to his base, gin them up and speak to these wedge issues of race that have these horrific consequences," she said of his rallies. Then, in a White House address with a broader audience, she said, he says things that "sound very presidential."

For example, Trump denounced white supremacy from the podium Monday.

"In one voice, our nation must condemn racism, bigotry and white supremacy," he said.

He said he would direct administration officials to propose legislation that would make those guilty of committing hate crimes and mass murders eligible for the death penalty. Dylann Roof, the Charleston church shooter, was sentenced to death after being convicted under existing federal hate crimes statutes.

But it was unclear how the potential application of the death penalty would serve as a deterrent to mass shootings in which the perpetrators often expect that they will be killed by police — as the Dayton gunman was — or kill themselves to avoid capture.

Trump offered little in the way of solace to those who believe guns and his own warnings of an "invasion" of Hispanics contributed to the El Paso shootings.

Former Vice President Joe Biden, the front-runner in the polls for the Democratic nomination to face Trump in 2020, wrote on Twitter that Trump's words Monday rang hollow.

"You use the office of the presidency to encourage and embolden white supremacy," Biden said. "You use words like 'infestation' and 'invasion' to talk about human beings. We won't truly speak with one voice against hatred until your voice is no longer in the White House."

On Monday, whether intentionally or not, Trump owned his role.