WASHINGTON — President Donald Trump condemned “racism, bigotry and white supremacy” in a televised address to the nation Monday after a devastating and bloody weekend left at least 30 people dead in two mass shootings in less than 24 hours.

"These sinister ideologies must be defeated. Hate has no place in America," the president said from the White House. "Hatred warps the mind, ravages the heart and devours the soul."

Just before the first attack in El Paso, Texas, on Saturday morning, the suspect — identified by police as a 21-year-old white man from the Dallas area — posted a diatribe against immigrants in Texas, a senior law enforcement official told NBC News. He also pushed talking points about preserving European identity in America.

The president did not specifically condemn anti-immigrant rhetoric on Monday, instead blaming violent video games and mental illness for the scourge of mass shootings that have been a steady drumbeat throughout his presidency. It is unclear if either of those factors played a role in the Texas shooting or the second attack early Sunday morning in Dayton, Ohio.

Trump also voiced support for stronger death penalty legislation for those who commit mass shootings, putting additional resources and new tools toward helping to identify early warning signs before shooters act, and reforming mental health laws.

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

During his address, the president misstated the Ohio city where the shooting took place, referring to "the memory of those who perished in Toledo."

White House officials told NBC News that Trump is expected to visit the two cities this week — news that has drawn criticism in both areas.

"From my perspective, he is not welcome here," said Rep. Veronica Escobar, a Democrat whose district includes El Paso. "He should not come here while we are in mourning,"

When asked about the visit, Dayton Mayor Nan Whaley referred to the president's earlier verbal slip. "I’ve heard that he’s coming Wednesday but I haven’t gotten a call," she said. "And, you know, he might be going to Toledo. I don’t know.”

Trump avoided calling for any specific gun control laws, in contrast to a tweet hours before his White House remarks in which he said Congress should pass background-check legislation tied to immigration reform, a move that could give Republicans leverage over Democrats in passing controversial immigration measures.

“We cannot let those killed in El Paso, Texas, and Dayton, Ohio, die in vain," Trump said in a pair of tweets Monday morning. "Likewise for those so seriously wounded. We can never forget them, and those many who came before them. Republicans and Democrats must come together and get strong background checks, perhaps marrying this legislation with desperately needed immigration reform."

He added, “We must have something good, if not GREAT, come out of these two tragic events!”

Trump also gave his support in his remarks to so-called red flag laws, which would allow family members to obtain a court order to take away a relative's firearm if they believe he or she posed a risk. The measure has been backed by Republicans while Democrats have focused on improving background checks.

It isn't known yet whether background checks or red flag laws could have played a role in preventing the two weekend shootings.

....this legislation with desperately needed immigration reform. We must have something good, if not GREAT, come out of these two tragic events! — Donald J. Trump (@realDonaldTrump) August 5, 2019

"The National Rifle Association welcomes the President’s call to address the root causes of the horrific acts of violence that have occurred in our country," the gun lobbying group said in a statement. "It has been the NRA’s long-standing position that those who have been adjudicated as a danger to themselves or others should not have access to firearms and should be admitted for treatment."

While criticizing social media in his White House remarks for stoking hatred, Trump used his Twitter account on Monday morning to blame the news media for "the anger and rage" that has led to a rash of mass shootings in the United States.

"The Media has a big responsibility to life and safety in our Country. Fake News has contributed greatly to the anger and rage that has built up over many years. News coverage has got to start being fair, balanced and unbiased, or these terrible problems will only get worse!" he wrote.

The Media has a big responsibility to life and safety in our Country. Fake News has contributed greatly to the anger and rage that has built up over many years. News coverage has got to start being fair, balanced and unbiased, or these terrible problems will only get worse! — Donald J. Trump (@realDonaldTrump) August 5, 2019

As president, and as a presidential candidate, Trump has been an avid supporter of Second Amendment rights.

Following the February 2018 shooting at Marjory Stoneman Douglas High School in Parkland, Florida, that left 17 students and teachers dead, Trump at first indicated he could support tightening background checks for gun buyers, but backed away and instead threw his support behind a proposal to arm and train some teachers how to use firearms and called for institutionalizing mentally ill people believed to be capable of violence. Trump has also moved to ban bump stocks, devices that allows semi-automatic rifles to fire continuously like machine guns.

In February, the Democratic-controlled House passed two bills that would have tightened background checks on gun buyers, but the GOP-controlled Senate never took up either of the bills, and Trump had promised to veto the legislation.

Senate Democrats on Sunday called on Senate Majority Leader Mitch McConnell, R-Ky., to cancel the chamber's August recess so that they can take up gun control legislation in the wake of two mass shootings this weekend and in Gilroy, California, on July 28 — including at least one of the bills the House passed in February.

That bill, dubbed the Bipartisan Background Checks Act of 2019, would create new background check requirements for gun transfers between unlicensed individuals. Under current law, only licensed gun dealers are required to conduct a background check for buyers.

The other bill the Democrats passed in February would extend to 10 days the amount of time federal officials have to complete a background check on a gun buyer before a sale is completed. Under current regulations, if a background check isn’t completed within three business days, the sale can be completed anyway.

Responding to Trump's tweets, Senate Minority Leader Chuck Schumer, D-N.Y., said Trump should push for passage of the House-passed background check legislation.

“Instead of flailing around blaming everything under the sun, if the president is serious about 'strong background checks,' there’s one thing he can do: Demand Leader McConnell put the bipartisan House-passed universal background checks legislation on the floor of the Senate for a vote,” Schumer said.

Trump's critics have pointed to his own anti-immigrant rhetoric in fueling a rise in hate crimes. He has called Mexican immigrants murders and rapists, referred to an influx of migrants as an "invasion," and said several minority members of Congress — including those born in the U.S. — should go back "where they came" from.

At a May rally in Florida, referring immigrants, he asked the crowd: "How do you stop these people?" When an audience member shouted "shoot them" and the crowd cheered the comment, Trump's response was that “only in the Panhandle can you get away with that statement.”

White House chief of staff Mick Mulvaney brushed aside the criticism, saying mental illness was to blame for the shootings, not the president's rhetoric.

"People are going to hear what they want to hear," Mulvaney said Sunday on Meet the Press. "My guess is this guy is in that parking lot in El Paso, Texas in that Walmart doing this even if Hillary Clinton is president."

Former Vice President Joe Biden, the frontrunner in the Democratic presidential accused Trump of using his position to "encourage and embolden white supremacy" with anti-immigrant comments.

"We won't truly speak with one voice against hatred until your voice is no longer in the White House," Biden said.