President Trump condemned hate and “white supremacy” Monday as he called for bipartisan action to spur nationwide “red flag” laws in response to two weekend shootings that took the lives of 31 people in Texas and Ohio.

But he failed to mention new background-check measures or legislation to ban assault ­weapons.

“In one voice, our nation must condemn racism, bigotry, and white supremacy. These sinister ideologies must be defeated,” Trump said in his remarks, referring to the El Paso gunman’s racist-filled manifesto, which targeted people of Mexican descent.

“Hate has no place in America. Hatred warps the mind, ravages the heart, and devours the soul.”

During the 10-minute speech from the White House’s Diplomatic Reception Room, the president directed the Justice Department to work with local authorities on “red flag” laws that would identify people who might be likely to commit ­violence.

He noted how the Parkland, Fla., school shooter in February 2018 exhibited numerous signs that he would do something destructive but “nobody did anything.”

The commander in chief called the back-to-back shootings in El Paso and Dayton, “domestic terrorism” and said he would ensure the FBI has whatever it needs to prevent further attacks.

“We have asked the FBI to identify all further resources they need to investigate and disrupt hate crimes and domestic terrorism,” Trump said.

But he also cast blame on the Internet and video games, saying, “We must stop the glorification of violence in our society.”

The president urged Congress to reform mental-health laws to ensure that psychologically disturbed individuals who may be prone to violence get treatment, and, if necessary, be ­involuntarily confined. He didn’t offer any specifics on legislation.

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

“First, we must do a better job of identifying and acting on early warning signs. I am directing the Department of Justice to work in . . . partnership with local, state and federal agencies, as well as social media companies, to develop tools that can detect mass shooters before they strike,” Trump said.

And he directed the department to propose legislation that would make people who carry out hate crimes and mass shootings eligible for the death penalty.

Missing during his remarks was a recommendation that Congress take action on background checks or linking gun legislation to immigration reform, as he said in tweets earlier Monday morning.

Senate Minority Leader Chuck Schumer and House Speaker Nancy Pelosi were quick to criticize.

“It took less than three hours for the president to back off his call for stronger background check legislation,” the two Democratic leaders said in a joint statement. “When he can’t mention guns while talking about gun violence, it shows the president remains prisoner to the gun lobby and the NRA.”

Trump also failed to mention restricting access to assault rifles or an outright ban on the weapons, used in the two weekend attacks, with which a gunman can rattle off dozens of high-powered rounds per minute.

Instead he harked back to measures already taken.

“Last year, we enacted the STOP School Violence and Fix NICS Acts into law . . . At my direction, the Department of Justice banned bump stocks,” Trump said.

“If we are able to pass great legislation after all of these years, we will ensure that those who were attacked will not have died in vain.”