Former President Barack Obama on Monday responded to this weekend's deadly mass shootings by calling for stricter gun control laws and tougher policing of online hate speech.

He also appeared to take a veiled shot at President Donald Trump over his anti-immigrant rhetoric that some have said has emboldened white supremacists in the U.S. The suspect in Saturday's shooting in El Paso, Texas is said to have made racist comments online prior the attack on the largely Latino area.

“We should soundly reject language coming out of the mouths of any of our leaders that feeds a climate of fear and hatred or normalizes racist sentiments; leaders who demonize those who don’t look like us, or suggest that other people, including immigrants, threaten our way of life, or refer to other people as sub-human, or imply that America belongs to just one certain type of people,” Obama said in a statement he tweeted out Monday afternoon.

“Such language isn’t new — it’s been at the root of most human tragedy throughout history, here in America and around the world,” Obama added. “It has no place in our politics and our public life. And it’s time for the overwhelming majority of Americans of goodwill, of every race and faith and political party, to say as much — clearly and unequivocally.”

The Texas attack, coupled with one that occurred early Sunday in Dayton, Ohio, left at least 31 people dead and dozens injured.

Obama did not mention Trump by name in his statement. But his words may have referred to harsh anti-immigrant rhetoric that the president has employed during his presidency. Trump, for example, has described Mexican immigrants as rapists and criminals and referred groups of migrants as part of an "invasion.” He also laughed when an audience member at a campaign rally in May appeared to suggest shooting immigrants.

Responding to the shootings on Monday morning, however, Trump condemned “racism, bigotry and white supremacy” and said that “hate has no place in America.”

Just before the first attack in El Paso 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.

Obama said law enforcement agencies and internet platforms “must come up with better strategies to reduce the influence” of hate groups that play a role in shootings like the one that occurred in El Paso.

“There are indications that the El Paso shooting follows a dangerous trend: troubled individuals who embrace racist ideologies and see themselves obligated to act violently to preserve white supremacy,” Obama wrote. “Like the followers of ISIS and other foreign terrorist organizations, these individuals may act alone, but they’ve been radicalized by white nationalist websites that proliferate on the internet.”

Obama also renewed his call for tougher gun control laws, saying that “the evidence shows that they can stop some killings.”

“They can save some families from heartbreak,” he wrote. “ We are not helpless here.”