“We weren’t in there through a miracle of God,” Ms. Silva said. Ms. Moreno’s mother, who lives in El Paso, drove them to her house, and the three of them spent the rest of the day hunkered down, afraid to go out.

Only as dusk fell did the pair venture out to buy some snacks and head back over the bridge.

“It’s sad that there are people who discriminate so much,” said Ms. Silva. “But we aren’t going to judge everybody because of one person.”

Karen Peña, 19, who lives in El Paso and was crossing the bridge to visit her mother in Ciudad Juárez, saw a broader threat to the shooting. “I think it’s because of the migrants,” she said, referring to the Central American migrants who have been arriving at the southern border in record numbers. “It’s a warning to scare them off,” she said.

Shopping excursions into the United States are a routine weekend activity for Mexicans. Back-to-school shopping, in particular, draws heavy crowds from across the border, and on Saturday, the Walmart store, the surrounding Cielo Vista mall and nearby hotels were packed with visitors.

At least six Mexican citizens were among the injured, the Mexican government reported. President Andrés Manuel López Obrador said Sunday morning that there were also Mexicans among the dead.

The Mexican government has refrained from commenting on the gunman’s possible targeting of Hispanics. But residents of El Paso, a majority Latino city where many people belong to extended families with members on both sides of the border, said there was little doubt that racism drove the gunman.

“He had a mission to kill people, but why Hispanics?” said Carmen Dominguez, 59, a hotel room attendant. “That Walmart is mostly people that cross the border. They come to buy school supplies.”

“Mexicans are very hard-working people,” she continued. “They were shopping for their kids. They save their money all year round to shop for their kids.”

Elisabeth Malkin, Caitlin Dickerson, Manny Fernandez, Jose A. Del Real, Rick Rojas, Arturo Rubio and Katie Benner contributed reporting.