EL PASO — A 21-year-old gunman armed with a powerful rifle turned a crowded Walmart store in this majority-Hispanic border city into a scene of chaos and bloodshed on Saturday, stalking shoppers in the aisles in an attack that left at least 20 people dead and 26 others wounded, the authorities said.

For several minutes late on Saturday morning, the packed Walmart near the Cielo Vista Mall on the city’s East Side filled with gun smoke and the echo of gunfire. Workers and customers, some bloodied, fled out the doors. Others huddled in the aisles or on the ground.

[For the latest updates, read our live briefing on the Dayton and El Paso shootings.]

“Texas grieves for the people of El Paso today,” the governor of Texas, Greg Abbott, told reporters. “On a day that would have been a normal day for someone to leisurely go shopping, turned into one of the most deadly days in the history of Texas.”

Manuel Uruchurtu, 20, had just paid at the cash register and was walking out of the store when he heard the sound of shots. He turned around and saw the gunman holding a long gun and wearing what looked like shoulder pads. As Mr. Uruchurtu fled the store, he saw two bodies on the ground outside, one surrounded by a pool of blood.