A man armed with an assault rifle has opened fire at a packed shopping area in El Paso, in the US state of Texas, killing at least 20 people and wounding 26 others, according to officials.

Authorities said on Saturday the suspect was arrested outside a Walmart store near the Cielo Vista Mall, eight kilometres from a border checkpoint with Mexico.

Police confirmed that a 21-year-old from Allen, Texas, was the only person in custody. US media identified the suspect as Patrick Wood Crusius, a white male. Police said he was believed to be the only shooter.

El Paso County records on Sunday showed Crusius was booked at the central jail in the city on capital murder charges. There was no immediate indication that he had an attorney.

Authorities said they were working to confirm whether a racist, anti-immigrant screed posted online shortly beforehand was written by the man arrested. The “manifesto” includes passages railing against the “Hispanic invasion” of Texas and the author makes clear that he expected to be killed during his attack.

The first sentence of the four-page document also expresses support for the gunman who opened fire at two New Zealand mosques in March, killing 51 people.

“Right now we have a manifesto from this individual that indicates to some degree, it has a nexus to potential hate crime,” El Paso Police Chief Greg Allen said.

Speaking to reporters, Texas Governor Greg Abbott said: “Lives were taken who should still be with us today. Twenty innocent people from El Paso have lost their lives and more than two dozen more are injured.”

He added: “We are going to aggressively prosecute it both as capital murder but also as a hate crime, which is exactly what it appears to be.”

Just hours after the El Paso attack, a mass shooting in Dayton, Ohio, left at least nine people dead and 26 wounded. Police killed the shooter at the scene.

At least 20 people were killed and 26 injured when a gunman opened fire in a packed shopping area of El Paso [KTSM 9/KTSM 9 news Channel/AFP]

Shopping centre ‘at capacity’

Mexico President Andres Manuel Lopez Obrador said three Mexicans had been killed in the shooting and Foreign Minister Marcelo Ebrard said on Twitter six others were wounded.

El Paso in West Texas, which has about 680,000 residents, sits across the border from Juarez, Mexico. The county is more than 80 percent Latino and Mexican citizens legally pass the border every day to work and shop in the US.

CCTV footage captured the gunman [KTSM 9 news Channel / AFP]

Various news reports said the ages of victims being treated at hospitals ranged from two to 82 years. About half of the wounded, including at least two children, were initially taken to the University Medical Center of El Paso, where a number of the victims remained in surgery hours later, hospital spokesman Ryan Mielke said.

Anywhere from 1,000 to 3,000 shoppers and about 100 employees were at the Walmart store when the gunman opened fire, according to Robert Gomez, a local police sergeant.

The shopping centre, described as being “at capacity” at the time of the shooting was particularly busy with customers buying goods for the upcoming school year.

Jordan Anchondo, a mother of three, had been shopping for school supplies when she was fatally shot, according to her sister, Leta Jamrowski. Anchondo’s two-month-old son was also wounded in the attack, she told The Associated Press news agency.

“From the baby’s injuries, they said that more than likely my sister was trying to shield him,” Jamrowski said from the waiting room at the University Medical Center of El Paso. “So when she got shot she was holding him and she fell on him, so that’s why he broke some of his bones. So he pretty much lived because she gave her life.”

Adair and I are devastated by the tragic events unfolding in our City. Our hearts go out to the victims and gratitude to our first responders. We will continue to keep you updated. pic.twitter.com/AKzgwtVWgs — Mayor Dee Margo (@mayor_margo) August 3, 2019

US President Donald Trump, who had visited El Paso in February in support of his plan for a wall along the southern border, called the shooting “an act of cowardice”, writing on Twitter: “I know that I stand with everyone in this Country to condemn today’s hateful act. There are no reasons or excuses that will ever justify killing innocent people.”

The incident ranked as the eighth-deadliest mass shooting in modern US history, taking place six days after a gunman killed three people at a summer food festival in northern California. It was the 21st mass killing in the United States in 2019.

Al Jazeera’s Rob Reynolds, reporting from El Paso, said the gunman in Texas had apparently travelled from his hometown in the suburbs of Dallas to commit the attack.

“That’s over 1,000km away,” Reynolds reported. “So he drove here, specifically to El Paso, to carry out this deed.”

A witness to the El Paso shooting, who gave her name as Vanessa, said she had just pulled into the car park of the Walmart and “all of a sudden you heard what sounded like fireworks, really loud fireworks”.

“You could hear the pops, one right after another and at that point, as I was turning, I saw a lady, seemed she was coming out of Walmart, headed to her car. She had her groceries in her cart and I saw her just fall,” she told Fox News.

The witness told Fox that she had seen one man open fire wearing what appeared to be combat fatigues.

“He was wearing a black T-shirt, camo-coloured pants. He was wearing something to cover his ears, like headphones, really thick ones.

“He was carrying a dark rifle and he was just pointing at people and just shooting and, yeah, the last thing I saw, he shot somebody that was in a corner.”

After seeing the woman fall in the parking lot, “that’s when I thought, okay, this is not – these aren’t fireworks … He was just shooting randomly. It wasn’t to any particular person. It was any that would cross paths”.

Several Democratic presidential candidates addressed the shooting while attending an event in support of unions in Las Vegas.

Former Texas congressman Beto O’Rourke, who is from El Paso, appeared shaken after the attacks.

“Yes it’s the gun laws, yes it’s the universal background checks and yes we should stop selling weapons of war to our communities,” O’Rourke told reporters in Las Vegas. “But I think we also have to confront this hatred that I have never seen in my lifetime.”