Former president Barack Obama released a statement Monday on the shootings over the weekend in Texas and Ohio. (Ethan Miller/Getty Images)

Former president Barack Obama called on the country Monday to reject words “coming out of the mouths of any of our leaders” that feed fear and hatred and normalize racist sentiments, a tacit rebuke of President Trump in the wake of the Texas and Ohio shootings.

In a statement posted to his Twitter and Facebook accounts, Obama said such language has been at the root of most human tragedy, from slavery to the Holocaust to the Rwandan genocide.

“It has no place in our politics and our public life,” he said. “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.”

Obama’s statement came hours after Trump delivered an address from the White House about the weekend of carnage in El Paso and Dayton, Ohio, that left 31 people dead and scores wounded.

In his remarks, Trump urged Americans to denounce bigotry and white supremacy and emphasized combating mental illness over taking new gun-control measures.

“In one voice, our nation must condemn racism, bigotry and white supremacy,” Trump said. “Hatred warps the mind, ravages the heart and devours the soul.”

Authorities believe the El Paso shooter posted an anti-immigrant screed on an online message board and are seriously considering charging the suspect with federal hate crimes.

Portions of the 2,300-word essay closely mirror Trump’s rhetoric, as well as the language of the white nationalist movement, including a warning about the “Hispanic invasion of Texas.”

Obama’s remarks Monday represent the most forceful political statement he has made since leaving office in 2017. The former president has typically steered clear of wading into politics, even declining to endorse his former vice president, Joe Biden, in the race for the 2020 Democratic nomination.

Obama did not mention Trump by name in his statement, although he sharply criticized the type of inflammatory rhetoric about immigrants and ethnic minorities that has become a staple of Trump’s reelection campaign.

“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.

He also compared white nationalist shooters to “followers of ISIS and other foreign terrorist organizations,” noting that they “may act alone, but they’ve been radicalized by white nationalist websites that proliferate on the internet.”

“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,” he said, calling on law enforcement and social media platforms to do more to reduce the influence of radical content online.

And he urged Americans to press lawmakers to tighten gun-control laws, although he did not point to any specific legislation.

“We are not helpless here,” he said. “And until all of us stand up and insist on holding public officials accountable for changing our gun laws, these tragedies will keep happening.”

John Wagner contributed to this report.