“I’m running for president,” he said firmly, when asked to respond to those pushing a Senate bid. “This community holds so much for the rest of the country. Whether it’s immigration, whether it’s our safety, whether it’s our connection to the rest of the world, whether it’s the fact that we’re on the front line of so many issues that can and will define America.”

El Paso, a friendly, bilingual border community that consistently ranks as one of America’s safest cities, has long been central to Mr. O’Rourke’s message. As he puts it, the diverse city is “a powerful example for the way forward for this country” — a point that has taken on a new urgency for Mr. O’Rourke, who has had a bigger national platform to make that case in the last week than at any point since launching his campaign.

In a nearly 40-minute interview, Mr. O’Rourke described feeling “deep sadness, great anger, overwhelming pride and just a very clear purpose in knowing what’s at stake.” He described how shaken his young children were by the shooting. And he detailed how moved he was by the grace, grit and even grim humor displayed by the many survivors and victims’ families he has met at vigils, funerals and hospitals.

Toward the end of the interview, he suggested that his experience in El Paso at this moment has uniquely prepared him to take on Mr. Trump, who has been accused of emboldening white nationalists through nativist and racist rhetoric.

The shooting suspect confessed to targeting Latinos, and his manifesto, which echoed Mr. Trump’s language, said the attack was “a response to the Hispanic invasion of Texas.”

“At a time that the president is attacking this community, this part of the world, the U.S.-Mexico border, cities of immigrants, that’s where I am,” Mr. O’Rourke said. “That’s where I live. That’s where we’re raising our family. I can meet him on this issue in very personal terms and from a place that no one else can.”