Several people have been killed and one person is in custody after a shooter went on a rampage on Saturday at a shopping centre in Texas.

Police in El Paso responded in the early afternoon to an active shooter scene at the Cielo Vista Mall, which is near interstate 10 on east side of the city, and were advising people to stay away from the area.

Shortly afterwards, Sergeant Enrique Carrillo, a police spokesman, said a suspect was in custody and there was no longer danger to the public. Police believe the attack was carried out by one man.

State Rep. Cesar Blanco said on MSNBC that he had received reports that at least 18 people had been shot.

NBC News reports that a University Medical Centre of El Paso official said it had received at least 10 seriously injured victims and that victims had also been taken to other hospitals.

US President Donald Trump posted a message on Twitter about the “terrible” shootings and pledged the support of the federal government to the state’s governor.

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

Presidential candidate and former Texas congressman Beto O’Rourke appeared a bit shaken as he appeared at a candidate forum in Las Vegas on Saturday shortly after news of the shooting in his hometown was reported.

Terrible shootings in ElPaso, Texas. Reports are very bad, many killed. Working with State and Local authorities, and Law Enforcement. Spoke to Governor to pledge total support of Federal Government. God be with you all!

O’Rourke said he had called his wife before taking the stage and said the shooting shatters “any illusion that we have that progress is inevitable” on tackling gun violence.

The Democrat said he had heard early reports the shooter might have had a military-style weapon, saying we need to “keep that (expletive) on the battlefield and do not bring it into our communities.”

“We have to find some reason for optimism and hope or else we consign ourselves to a future where nearly 40,000 people are year will lose their lives to gun violence and I cannot accept that,” Mr O’Rourke said.