The president, she said, was “too busy” to talk, and she declined to join him in his visit. “I refuse to be an accessory to his visit.”

El Paso treasures its place as part of a community that straddles two countries. Its vibrancy, many said, comes from its bond with Mexico, with a history that is older than that of the United States.

“He doesn’t really know who we are,” said Judy Lugo, president of the Texas State Employees Union, which represents some 10,000 state workers, of Mr. Trump’s visit. “He doesn’t know our culture, the long history we have. He doesn’t understand.”

“We are a community of love, a community of family,” Ms. Lugo said. “We are not what he says we are. We are not rapists. We are not dirty. We are not criminals.”

Across the city, some residents worried that Mr. Trump’s visit might do more harm than good.

“He’s just putting salt on the wound,” Ninamarie Ochoa, 29, a teacher, said of Mr. Trump’s visit. Referring to white nationalists who express views like those of the suspect in the attack and the recent detention in tent camps of thousands of migrants arriving in El Paso, she said, “I think that the way he has empowered those voices, to give them license to act on it, you see this in the way that people talk about ICE and Border Patrol and their complacency with the concentration camps.”

Wednesday’s visit was intended as an opportunity for Mr. Trump to console family members and survivors and help commemorate those who died in Saturday’s attack. But few seemed ready to bridge a gap between the city and the president that had grown wide even before the shooting.