Authorities in Texas are quizzing a 21-year-old white man – suspected of posting a racist “manifesto” online – believed to be responsible for a gun attack on a shopping centre that killed 20 people and which police said was the “nexus of a hate crime”.

Video phone footage taken inside a mall in El Paso showed people running in fear for their lives after the shooter entered a Walmart store with a semiautomatic weapon and opened fire. In addition to the 20 fatalities, at least two-dozen people were injured in the latest incident of gun violence to scar the nation.

It appears the suspected shooter – named by multiple media accounts as Patrick Crusius – drove up to 10 hours from Alen, a town near Dallas, to target the store in El Paso, a city on the border with Mexico that has long been a home to immigrants. An online posting apparently written several days ago, said the attack was a response to the “Hispanic invasion of Texas”.

“Even if other non-immigrant targets would have a greater impact, I can’t bring myself to kill my fellow Americans,” it said. “In short, America is rotting from the inside out, and peaceful means to stop this seem to be nearly impossible. The inconvenient truth is that our leaders, both Democrat AND Republican, have been failing us for decades.”

CNN said that Facebook was working with police in the aftermath of the shooting to remove a Facebook and Instagram account associated with the suspect.

Mass shootings in America Show all 8 1 /8 Mass shootings in America Mass shootings in America Camden shootings – 1949 Howard Unruh killed 13 people, including three children, during a 12-minute walk through his neighborhood on September 6, 1949, in Camden, New Jersey, when he was 28 years old. The incident became known as the "Walk of Death". Unruh was found to be criminally insane and died in 2009 after a lengthy illness at the age of 88, following 60 years of confinement. Alamy Mass shootings in America University of Texas tower shooting – 1966 Charles Whitman killed 17 people and injured 31 others in Austin, Texas. After stabbing his mother and wife the night before, he headed to the University of Texas, where he opened fire on people in the campus and streets from the observation desk. He was shot dead after a policeman and civilian reached the scene. Austin History Center, Austin Public Library Mass shootings in America Easter Sunday Massacre – 1975 James Ruppert killd 11 family members in his mother's house, which included his mother, brother and his wife, as well as their eight children. He used a magnum, two handguns and a rifle. Mass shootings in America Wilkes-Barre shootings – 1982 Former prison guard, George Banks, shot dead 13 people in Pennsylvania, including five of his own children. AP Photo/Times Leader Mass shootings in America Wah Mee massacre – 1983 Three men, Kwan Fai Mak, Wai-Chiu Ng, and Benjamin Ng, killed 13 people who were in Seattle's Wah Mee gambling club. YouTube/KIRO 7 News Mass shootings in America San Ysidro McDonald's massacre – 1984 James Huberty killed 21 people and injured 19 others after he walked in a McDonald's in San Diego. He was shot dead by a sniper after 78 minutes of him entering the restaurant. Alamy Mass shootings in America Palm Sunday massacre – 1984 Ten people were shot dead from handguns at close range in a New York home. A baby girl was the only survivor after convicted dealer, Christopher Thomas, shot three women, one teenage girl and six children in their Brooklyn home. Thomas was convicted of manslaughter and cleared of murder. He was released from prison after 32 years. Mass shootings in America Edmond post office shooting – 1986 Patrick Sherrill, a postal worker at the Edmond post office in Oklahoma, killed 14 co-workers and injured 6 others, before he shot himself. Oklahoma Highway Patrol Collection

“Our thoughts are with the victims and their families,” the company said in a statement. “Content that praises, supports or represents the shooting or anyone responsible violates our community standards and we will continue to remove as soon as we identify it.”

At a press conference, Texas governor Greg Abbot who has long been a supporter of gun rights and and an opponent of effort to regulate the sale or carrying of weapons, described the incident as one of the of the “deadliest days in history of Texas”.

On Twitter, he wrote: “Now in the beautiful city of El Paso. Texans grieve today for the people of this wonderful place. We ask God to bind up the wounds of all who’ve been harmed.”

Support free-thinking journalism and attend Independent events

Meanwhile Donald Trump, who has placed anti-immigration rhetoric at the centre of his reelection campaign, and who was recently formally condemned by the House of Representatives for a series of racist tweets in which he told four Democratic congresswomen to “go back" to their "original countries", said the incident was “terrible”.

“Working with state and local authorities, and law enforcement,” the president wrote. “Spoke to governor to pledge total support of federal government. God be with you all!”

The document believed to have been written by the suspect claimed the president’s words had not been his inspiration. It also spoke in support of the Christchurch mosque shootings, in which 51 people were killed in two consecutive attacks in New Zealand in March.

“I know that the media will probably call me a white supremacist anyway and blame Trump’s rhetoric,” it said. “The media is infamous for fake news. Their reaction to this attack will likely just confirm that.”

El Paso police chief Greg Allen said the manifesto from the suspect indicated “there is a potential nexus to a hate crime”. He said the suspect was taken into custody without incident when confronted by police and was being questioned.