Twenty people have been killed and more than two-dozen injured after a shooting at a shopping complex in Texas – the latest act of deadly gun violence to shudder across the United States.

Officials in the city of El Paso said multiple people had been killed and many injured after the incident at the Cielo Vista Mall, after a man with a rifle entered a Walmart and opened fire. Police said one suspect – a man – had been detained, after earlier reports said up to three had been seized.

Police urged people to stay away from the scene as armed officials conducted a complete search, but said the incident was no longer “active”.

“Right now we’re searching multiple scenes,” Sgt Enrique Carillo told reporters at the scene.

“We have a tactical team going on search. It’s not an active shooter situation, but that’s not to say it’s been rendered safe.”

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

Phone video posted on social media showed people fleeing the mall and shouting in panic.

“We in the level above and we’re locked down. But we can see the scene. There’s police, FBI – they have the place closed down,” a man who goes by the name of Buster and manages a Hooters’ restaurant at the mall, told The Independent by telephone.

He said 26 people, including two customers, were among those sheltering in the restaurant. “It’s scary but I believe God is going to keep us safe,” he said.

El Paso, which has about 680,000 residents, is in West Texas and sits across the border from Juarez, Mexico.

“This is a tragedy that I’m having a hard time getting my arms around, frankly,” said the city’s mayor, Dee Margo, speaking on CNN.

He later wrote on Twitter: “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.”

Texas Lt Gov Dan Patrick told Fox News a 21-year-old man was in custody in connection with the shooting, and that between 15-20 had been shot. There was no confirmation as to how many people had lost their lives.

Support free-thinking journalism and attend Independent events

Donald Trump called the shooting “terrible”, saying on Twitter that he offered the government’s support to Texas governor Greg Abbott.

“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!”

A spokesman for the El Paso police department later said the operation was now becoming a murder investigation after a person had been taken into custody. Sgt Robert Gomez said they did not believe anyone was “outstanding”, but said the situation was fluid.

Walmart issued its own statement, saying the company was “praying for the victims, the community and and our associates, as well as the first responders”. The statement added: “We’re working closely with law enforcement and will update as appropriate.”

Democratic presidential candidate Beto O’Rourke, who is from El Paso, spoke emotionally about the shooting while in Las Vegas, where he was campaigning.

“I’m thinking about El Paso, I want you to be thinking about El Paso as well,” Mr O’Rourke told the audience, after taking the stage at a labour union forum.

Medical officials said that at least 22 people had been shot in the incident.

Eleven were take to the University Medical Centre of El Paso, according to Ryan Mielke, the hospital’s director of public affairs. Their injuries ranged from severe to non-life threatening.