A 21-year-old white man was arrested at the scene of the attack in the city of El Paso, near the US-Mexico border.
He is believed to have posted an online document calling the attack a response to "the Hispanic invasion of Texas".
US President Donald Trump has said "perhaps more has to be done" to prevent mass shootings.
"Hate has no place in our country, and we are going to take care of it," he told reporters on Sunday. "This has been going on for years, for years and years in our country and we have to get it stopped."