CIUDAD JUÁREZ, Mexico — Mexico demanded protections for Mexicans and Mexican-Americans living in the United States and threatened legal action on Sunday, a day after the shooting at an El Paso Walmart that left Mexican citizens among the dead and wounded.

Mexican authorities could seek to extradite the gunman on a terrorism charge and were planning legal action against the seller who provided the shooter with his weapon, said the foreign minister, Marcelo Ebrard.

“We consider that the issue of arms is crucial,” he said.

The gunman who killed 20 in Saturday’s attack wrote an anti-immigrant manifesto that spoke of a “Hispanic invasion of Texas,” and many Mexicans saw the shooting as an expression of the tensions simmering between the United States and Mexico over immigration, guns and violence.

These tensions are often fueled by President Trump in divisive invectives that target Mexicans, Central Americans and others, and speak of migrant caravans as “an invasion of our country.”