Media playback is unsupported on your device Media caption A soldier and a baseball coach recall how they tried to save children from the El Paso shooting

President Donald Trump said "hate has no place" in the US after 29 people were killed in two mass shootings over the weekend, amid accusations that he bore some responsibility.

An attack on a Walmart store in El Paso, Texas left 20 dead, while nine died in a shooting in Dayton, Ohio.

The president said "perhaps more has to be done" to address gun violence.

Democrats said Mr Trump was part of the problem, citing his anti-immigrant rhetoric and opposition to gun control.

A 21-year-old white man arrested over Saturday's shooting in Texas is believed to have posted an online document calling the attack a response to "the Hispanic invasion" of the state.

The motives of the Ohio gunman, who killed his sister and eight others on Sunday before being shot dead by police, are unclear.

Mr Trump is set to give a national address about the shootings.

Before the statement, he tweeted to suggest both his Republican Party and Democrats should come together to pass new background check legislation, while suggesting it could be married with "desperately needed immigration reform".

"We must have something good, if not GREAT, come out of these two tragic events!" he posted.

Speaking to reporters on Sunday, Mr Trump said mass shootings needed to be stopped. He also described both gunmen as "very, very seriously mentally ill".

Investigators have not made any comments about the mental state of the two gunmen.

Media playback is unsupported on your device Media caption Donald Trump spoke to reporters before boarding Air Force One

Texan prosecutors say the El Paso shooting is being treated as "a domestic terrorist case" and they are "seriously considering" hate crime charges.

Gun control with strings attached

Since the mass shootings on Saturday, Democrats have vigorously called for new national gun-control measures. On Monday Donald Trump said he would help - with a big string attached.

The president's suggestion of packaging expanded background checks for gun purchases (something many Republicans hate) with his much-desired immigration reforms (something Democrats loathe) would require considerable political and legislative skill to shepherd through Congress. Those are attributes the president has not consistently demonstrated.

Democrats will howl that calling for immigration reforms they view as inextricably tied to the president's anti-immigrant rhetoric just days after an anti-immigrant mass murder is offensive in the extreme.

If this is a trial balloon, it will land with a thud.

The president's tweets may be his effort to shift the focus from what critics say is his responsibility for the spread of white nationalism in the US. Mr Trump has so far blamed mental illness and the media for the shootings, but pressure will mount for him to address the threat of what even some in his own party are calling "white terrorism".

A gun-control and immigration debate is familiar territory. A consideration of political rhetoric in the Trump era could hit too close to home.

What happened in El Paso?

The gunman opened fire on a crowded Walmart on Saturday with a semi-automatic rifle, and surrendered after being confronted by police officers outside the store.

The mass shooting, believed to be the eighth deadliest in modern US history, took place in a city where most of the population of 680,000 is of Hispanic descent.

In addition to the 20 fatalities, 26 people were injured.

Image copyright Getty Images Image caption A sign in support of El Paso, near the scene of the shooting

The Walmart, near the Cielo Vista Mall, was full of shoppers buying back-to-school supplies at the time of the shooting, and witnesses described scenes of chaos as customers fled for their lives.

Security camera images of the attacker show an armed man in a dark T-shirt wearing glasses and what appear to be ear protectors.

The victims have not yet been named by police, but Mexico's President Andrés Manuel López Obrador said six Mexican nationals were among the dead and seven others were injured.

The suspect has been named by US media as Patrick Crusius, a resident of the city of Allen, in the Dallas area, about 650 miles (1,046km) east of El Paso.

He has been charged with capital murder, meaning he could face the death penalty.

Media playback is unsupported on your device Media caption Police were filmed responding to the shootings

He is believed to be the author of a text posted on 8chan, an online message board frequently used by the far right, which says "this attack is a response to the Hispanic invasion of Texas" and talks about "cultural and ethnic replacement brought on by invasion".

The four-page document, reportedly posted some 20 minutes before police received the first emergency call from the Walmart, also expresses support for the gunman who killed 51 people in Christchurch, New Zealand, in March.

US cyber security firm Cloudflare said it would terminate 8chan as a customer following the attack.

"The rationale is simple: they have proven themselves to be lawless and that lawlessness has caused multiple tragic deaths," Cloudflare chief executive officer Matthew Prince wrote in a blog post.

Mexican Foreign Minister Marcelo Ebrard said the attorney general was considering litigation claiming that terrorism was committed against Mexicans in the shooting.

What happened in Dayton?

A gunman killed his sister and eight others in an attack that lasted only 30 seconds at a popular nightlife district in the early hours of Sunday morning.

Security camera footage shows dozens of people racing through the doorway of the local Ned Peppers nightclub.

Seconds later, the gunman - identified as Connor Betts, 24 - is seen running towards the venue and being hit by police gunfire as he reaches the door.

Police said he had worn body armour and came carrying extra ammunition for his semi-automatic rifle with high-capacity magazines.

Media playback is unsupported on your device Media caption CCTV footage captures moment of Dayton shooting

"Had this individual made it through the doorway of Ned Peppers with that level of weaponry, there would have been catastrophic injury and loss of life," said Dayton Police Chief Richard Biehl.

Officials said it was too early to speculate about motives for the attack.

But responding to questions about a possible racial element to the killings, Mr Biehl said there was nothing to suggest a "bias motive".

Media playback is unsupported on your device Media caption Dayton shooting witness: "As you came outside, you saw the bodies"

Police say the rifle was ordered online from Texas and there was nothing in the gunman's history that would have stopped him from buying the gun legally.

Since the shooting, a number of the gunman's former classmates have came forward to say he was expelled from high school for having a "hit list" of people he allegedly wanted to kill.

His sister Megan was among the dead. Police listed all nine of the victims:

Lois Oglesby, 27

Megan Betts, 22

Saeed Saleh, 38

Derrick Fudge, 57

Logan Turner, 30

Nicholas Cumer, 25

Thomas McNichols, 25

Beatrice Warren Curtis, 36

Monica Brickhouse, 39

Twenty-seven others were injured in the attack.

What has the reaction been?

The shootings have given renewed momentum to the gun control debate, with some lawmakers urging Congress to reconvene to pass new background check legislation.

The El Paso attack has also led to fresh scrutiny of the president's rhetoric. Some leading Democratic politicians have accused him of stoking white nationalism and inciting violence.

"He's an open avowed racist and is encouraging more racism in this country," presidential candidate and El Paso native Beto O'Rourke told CNN.

"Our president isn't just failing to confront and disarm these domestic terrorists, he is amplifying and condoning their hate," tweeted fellow Democratic presidential hopeful Pete Buttigieg.

Democratic Senator Bernie Sanders said Mr Trump's language "creates a climate which emboldens violent extremists".

But acting White House chief of staff Mick Mulvaney rejected the Democrats' allegations and attributed the attacks to "sick" individuals.

"There's no benefit here in trying to make this a political issue, this is a social issue and we need to address it as that," he told ABC.

Media playback is unsupported on your device Media caption After the Las Vegas attack in October 2017 the BBC looked at how US mass shootings are getting worse

Mr Trump, who has made curbing illegal immigration a priority, has previously made derogatory comments about Mexican migrants and has called large groups of migrants trying to reach the US an "invasion".

In recent weeks, he has been accused of racism after his attacks on members of Congress who are members of racial or ethnic minorities.

Last month, FBI Director Christopher Wray revealed that the agency had made about 100 domestic terror arrests since October - the majority of which he said were motivated by some form of "white supremacist violence".

There has been a number of other high-profile attacks linked to the far right in recent years, including two deadly shootings at US synagogues.

Are mass shootings getting more frequent?

People in the US are no more likely to be involved in mass shootings now than they were in the 1980s or 90s. That's because the number of mass shootings in the US has risen in line with the increase in population since then.

Of all US shooting incidents so far this year, only 0.8% were mass shootings - involving four or more people being shot - according to the Gun Violence Archive.

But because the overall number of shootings in the US is so high, so too is the number of mass shootings - there have been 255 so far in 2019. The number of people being killed in mass shootings has also increased significantly in recent years. There are several reasons for this, including access to more powerful weapons.