U.S. President Donald Trump on Monday condemned weekend shootings in Texas and Ohio as "barbaric" attacks and crimes "against all humanity" as he called for bipartisan co-operation to strengthen the nation's gun laws.

Trump said he wants legislation providing "strong background checks" for gun users, but he provided scant details and has reneged on previous promises after mass shootings.

"We vow to act with urgent resolve," Trump said Monday.

Trump spoke Monday from the White House about shootings that left 31 dead and dozens wounded. He suggested early on Twitter that a background check bill could be paired with his long-sought effort to toughen the nation's immigration system.

But he didn't say how or why he was connecting the issues. Both shooting suspects were U.S. citizens, and federal officials are investigating anti-immigrant bias as a potential motive for the El Paso, Texas, massacre.

People take part in a rally against hate Sunday, a day after a mass shooting at a Walmart store, in El Paso, Texas. A 21-year-old Dallas-area man is charged in the deaths of 20 people. (Jose Luis Gonzalez/Reuters)

"In one voice, our nation must condemn racism, bigotry and white supremacy," Trump said, adding that he had directed the FBI to examine steps to identify and address domestic terrorism. "These sinister ideologies must be defeated. Hate has no place in America," he said.

Trump alleged the gunman who killed 20 people at a shopping centre in El Paso on Saturday was "consumed with racist hate," and said law enforcement should be able to prevent more of the nation's gun crimes.

"We must reform our mental health laws to better identify mentally disturbed individuals who may commit acts of violence, and make sure those people not only get treatment, but when necessary, involuntarily confinement.

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

Trump has frequently sought to tie his immigration priorities — a border wall and transforming the legal immigration system to one that prioritizes merit over familial ties — to legislation around which he perceives momentum to be building.

Over the weekend, Trump tried to assure Americans he was dealing with the problem and defended his administration in light of criticism following the latest in a string of mass shootings.

A vigil was held in Dayton, Ohio, on Sunday hours after a shooting in the entertainment district left nine people dead, as well as the gunman, a man in his early 20s who was shot by police. (Bryan Woolston/Reuters)

"We have done much more than most administrations," he said, without elaboration. "We have done actually a lot. But perhaps more has to be done."

Congress has proven unable to pass substantial gun violence legislation this session, despite the frequency of mass shootings, in large part because of resistance from Republicans, particularly in the GOP-controlled Senate. That political dynamic seems difficult to change.

And Trump himself has reneged on previous pledges to strengthen gun laws.

....this legislation with desperately needed immigration reform. We must have something good, if not GREAT, come out of these two tragic events! —@realDonaldTrump

After other mass shootings he called for strengthening the federal background check system, and in 2018 he signed legislation to increase federal agency data sharing into the system. But he has resisted Democratic calls to toughen other gun control laws.

In February, the House approved bipartisan legislation to require federal background checks for all gun sales and transfers and approved legislation to allow a review period of up to 10 days for background checks on firearms purchases. The White House threatened a presidential veto if those measures passed Congress.

At a February meeting with survivors and family members of the 2018 Parkland, Fla., school shooting in which 17 people died, Trump promised to be "very strong on background checks."

Trump claimed he would stand up to the gun lobby and finally get results in quelling gun violence. But he later retreated, expressing support for modest changes to the federal background check system and for arming teachers.

Senate Democratic leader Chuck Schumer tweeted that if Trump is serious about strengthening background checks, he should demand Senate Majority Leader Mitch McConnell "put the bipartisan, House-passed universal background checks bill up for a vote."

In the El Paso attack, investigators are focusing on whether it was a hate crime after the emergence of a racist, anti-immigrant screed that was posted online shortly beforehand. Detectives sought to determine if it was written by the man who was arrested. The border city has figured prominently in the immigration debate and is home to 680,000 people, most of them Latino.

On Twitter on Monday, Trump seemed to deflect from scrutiny over the manifesto, which had language mirroring some of his own. As Democrats have called on Trump to tone down his rhetoric, Trump blamed the news media for the nation's woes.

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! —@realDonaldTrump

"Fake News has contributed greatly to the anger and rage that has built up over many years," he claimed.

Trump 'not welcome' in El Paso

As Trump weighs trips to the affected communities — the Federal Aviation Administration advised pilots of a presidential visit Wednesday to El Paso and Dayton, Ohio — local lawmakers signalled opposition to his presence.

Rep. Veronica Escobar, a Democrat who represents El Paso, said Trump is "not welcome" to visit the city.

In recent weeks, the president has issued racist tweets about four women of colour who serve in Congress, and in rallies has spoken of an "invasion" at the southern border.

Trump also has been widely criticized for offering a false equivalency when discussing racial violence, notably when he said there were "very fine people, on both sides," after a white supremacist rally in Charlottesville, Va., that resulted in the death of an anti-racism demonstrator.

On gun control, a majority of Americans have consistently said they support stronger laws, but proposals have stalled repeatedly in Congress, a marked contrast to some countries that have acted swiftly after a mass shooting.

In March, a poll conducted by The Associated Press-NORC Center for Public Affairs Research found a majority of Americans favour stricter gun laws. The survey was conducted both before and after a mass shooting at two mosques in New Zealand. It found that 67 per cent of Americans support making U.S. gun laws stricter, while 22 per cent say they should be left as they are, and 10 per cent think they should be made less strict.

Less than a week after the mosque shootings, New Zealand moved to ban "military-style" semi-automatic weapons and high-capacity magazines; similarly, after a mass shooting in 1996, Australia enacted sweeping gun bans within two weeks.

The poll suggested many Americans would support similar measures, but there's a wide gulf between Democrats and Republicans on banning specific types of guns. Overall, six in 10 Americans support a ban on AR-15 rifles and similar semiautomatic weapons. Roughly eight in 10 Democrats, but just about four in 10 Republicans, support that policy.